/*******************************************************************************
 * Copyright (c) 2025-08-25 @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>. All rights
 * reserved. Contributors: <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> - initial API and
 * implementation.
 ******************************************************************************/
package org.iff.util;

import org.apache.commons.lang3.*;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.*;
import java.util.function.Supplier;
import java.util.regex.Pattern;

/**
 * StrEx
 *
 * @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a>
 * @since 2025-08-25
 */
public class StrEx implements CharSequence, Cloneable {
    /**
     * A String for a space character.
     *
     * @since 3.2
     */
    public static final String SPACE = " ";

    /**
     * The empty String {@code ""}.
     *
     * @since 2.0
     */
    public static final String EMPTY = "";

    /**
     * A String for linefeed LF ("\n").
     *
     * @see <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.6">JLF:
     *      Escape Sequences for Character and String Literals</a>
     * @since 3.2
     */
    public static final String LF = "\n";

    /**
     * A String for carriage return CR ("\r").
     *
     * @see <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.6">JLF:
     *      Escape Sequences for Character and String Literals</a>
     * @since 3.2
     */
    public static final String CR = "\r";

    /**
     * Represents a failed index search.
     *
     * @since 2.1
     */
    public static final int INDEX_NOT_FOUND = -1;

    private String str;
    private String old;

    public StrEx() {}

    public StrEx(String str) {
        this.str = str;
    }

    public static StrEx of() {
        return new StrEx();
    }

    public static StrEx of(CharSequence str) {
        return new StrEx(str == null ? null : str.toString());
    }

    public static List<StrEx> ofList(List<? extends CharSequence> strList) {
        return Utils.collect(strList, s -> of(s));
    }

    public static List<StrEx> ofList(String[] strArr) {
        return ofList(Utils.toList(strArr));
    }

    public static StrEx[] ofArr(String[] strArr) {
        if (strArr == null) {
            return new StrEx[0];
        }
        StrEx[] arr = new StrEx[strArr.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = of(strArr[i]);
        }
        return arr;
    }

    public StrEx with(CharSequence str) {
        this.str = str == null ? null : str.toString();
        return this;
    }

    /**
     * Save current value to old.
     */
    public StrEx record() {
        old = str;
        return this;
    }

    /**
     * get the record value.
     * 
     * @return
     */
    public String getOld() {
        return old;
    }

    public StrEx safe() {
        return with(str == null ? "" : str);
    }

    public String toS() {
        return str;
    }

    public boolean isNull() {
        return str == null;
    }

    public char charAt(int index, char defaultValue) {
        return index > -1 && index < str.length() ? str.charAt(index) : defaultValue;
    }

    @Override
    public char charAt(int index) {
        return str.charAt(index);
    }

    @Override
    public String toString() {
        return str;
    }

    @Override
    public StrEx clone() {
        return of(old).record().with(str);
    }

    /**
     * Abbreviates a String using ellipses. This will turn "Now is the time for all good men" into "Now
     * is the time for..."
     * <p>
     * Specifically:
     * </p>
     * <ul>
     * <li>If the number of characters in {@code str} is less than or equal to {@code maxWidth}, return
     * {@code str}.</li>
     * <li>Else abbreviate it to {@code (substring(str, 0, max-3) + "...")}.</li>
     * <li>If {@code maxWidth} is less than {@code 4}, throw an {@link IllegalArgumentException}.</li>
     * <li>In no case will it return a String of length greater than {@code maxWidth}.</li>
     * </ul>
     *
     * <pre>
     * StringUtils.abbreviate(null, *)      = null
     * StringUtils.abbreviate("", 4)        = ""
     * StringUtils.abbreviate("abcdefg", 6) = "abc..."
     * StringUtils.abbreviate("abcdefg", 7) = "abcdefg"
     * StringUtils.abbreviate("abcdefg", 8) = "abcdefg"
     * StringUtils.abbreviate("abcdefg", 4) = "a..."
     * StringUtils.abbreviate("abcdefg", 3) = IllegalArgumentException
     * </pre>
     *
     * @param maxWidth maximum length of result String, must be at least 4
     * @return abbreviated String, {@code null} if null String input
     * @throws IllegalArgumentException if the width is too small
     * @since 2.0
     */
    public StrEx abbreviate(final int maxWidth) {
        return abbreviate("...", 0, maxWidth);
    }

    /**
     * Abbreviates a String using ellipses. This will turn "Now is the time for all good men" into
     * "...is the time for..."
     * <p>
     * Works like {@code abbreviate(String, int)}, but allows you to specify a "left edge" offset. Note
     * that this left edge is not necessarily going to be the leftmost character in the result, or the
     * first character following the ellipses, but it will appear somewhere in the result.
     * <p>
     * In no case will it return a String of length greater than {@code maxWidth}.
     * </p>
     *
     * <pre>
     * StringUtils.abbreviate(null, *, *)                = null
     * StringUtils.abbreviate("", 0, 4)                  = ""
     * StringUtils.abbreviate("abcdefghijklmno", -1, 10) = "abcdefg..."
     * StringUtils.abbreviate("abcdefghijklmno", 0, 10)  = "abcdefg..."
     * StringUtils.abbreviate("abcdefghijklmno", 1, 10)  = "abcdefg..."
     * StringUtils.abbreviate("abcdefghijklmno", 4, 10)  = "abcdefg..."
     * StringUtils.abbreviate("abcdefghijklmno", 5, 10)  = "...fghi..."
     * StringUtils.abbreviate("abcdefghijklmno", 6, 10)  = "...ghij..."
     * StringUtils.abbreviate("abcdefghijklmno", 8, 10)  = "...ijklmno"
     * StringUtils.abbreviate("abcdefghijklmno", 10, 10) = "...ijklmno"
     * StringUtils.abbreviate("abcdefghijklmno", 12, 10) = "...ijklmno"
     * StringUtils.abbreviate("abcdefghij", 0, 3)        = IllegalArgumentException
     * StringUtils.abbreviate("abcdefghij", 5, 6)        = IllegalArgumentException
     * </pre>
     *
     * @param offset left edge of source String
     * @param maxWidth maximum length of result String, must be at least 4
     * @return abbreviated String, {@code null} if null String input
     * @throws IllegalArgumentException if the width is too small
     * @since 2.0
     */
    public StrEx abbreviate(final int offset, final int maxWidth) {
        return abbreviate("...", offset, maxWidth);
    }

    /**
     * Abbreviates a String using another given String as replacement marker. This will turn "Now is the
     * time for all good men" into "Now is the time for..." if "..." was defined as the replacement
     * marker.
     * <p>
     * Specifically:
     * </p>
     * <ul>
     * <li>If the number of characters in {@code str} is less than or equal to {@code maxWidth}, return
     * {@code str}.</li>
     * <li>Else abbreviate it to
     * {@code (substring(str, 0, max-abbrevMarker.length) + abbrevMarker)}.</li>
     * <li>If {@code maxWidth} is less than {@code abbrevMarker.length + 1}, throw an
     * {@link IllegalArgumentException}.</li>
     * <li>In no case will it return a String of length greater than {@code maxWidth}.</li>
     * </ul>
     *
     * <pre>
     * StringUtils.abbreviate(null, "...", *)      = null
     * StringUtils.abbreviate("abcdefg", null, *)  = "abcdefg"
     * StringUtils.abbreviate("", "...", 4)        = ""
     * StringUtils.abbreviate("abcdefg", ".", 5)   = "abcd."
     * StringUtils.abbreviate("abcdefg", ".", 7)   = "abcdefg"
     * StringUtils.abbreviate("abcdefg", ".", 8)   = "abcdefg"
     * StringUtils.abbreviate("abcdefg", "..", 4)  = "ab.."
     * StringUtils.abbreviate("abcdefg", "..", 3)  = "a.."
     * StringUtils.abbreviate("abcdefg", "..", 2)  = IllegalArgumentException
     * StringUtils.abbreviate("abcdefg", "...", 3) = IllegalArgumentException
     * </pre>
     *
     * @param abbrevMarker the String used as replacement marker
     * @param maxWidth maximum length of result String, must be at least {@code abbrevMarker.length + 1}
     * @return abbreviated String, {@code null} if null String input
     * @throws IllegalArgumentException if the width is too small
     * @since 3.6
     */
    public StrEx abbreviate(final String abbrevMarker, final int maxWidth) {
        return abbreviate(abbrevMarker, 0, maxWidth);
    }

    /**
     * Abbreviates a String using a given replacement marker. This will turn "Now is the time for all
     * good men" into "...is the time for..." if "..." was defined as the replacement marker.
     * <p>
     * Works like {@code abbreviate(String, String, int)}, but allows you to specify a "left edge"
     * offset. Note that this left edge is not necessarily going to be the leftmost character in the
     * result, or the first character following the replacement marker, but it will appear somewhere in
     * the result.
     * <p>
     * In no case will it return a String of length greater than {@code maxWidth}.
     * </p>
     *
     * <pre>
     * StringUtils.abbreviate(null, null, *, *)                 = null
     * StringUtils.abbreviate("abcdefghijklmno", null, *, *)    = "abcdefghijklmno"
     * StringUtils.abbreviate("", "...", 0, 4)                  = ""
     * StringUtils.abbreviate("abcdefghijklmno", "---", -1, 10) = "abcdefg---"
     * StringUtils.abbreviate("abcdefghijklmno", ",", 0, 10)    = "abcdefghi,"
     * StringUtils.abbreviate("abcdefghijklmno", ",", 1, 10)    = "abcdefghi,"
     * StringUtils.abbreviate("abcdefghijklmno", ",", 2, 10)    = "abcdefghi,"
     * StringUtils.abbreviate("abcdefghijklmno", "::", 4, 10)   = "::efghij::"
     * StringUtils.abbreviate("abcdefghijklmno", "...", 6, 10)  = "...ghij..."
     * StringUtils.abbreviate("abcdefghijklmno", "*", 9, 10)    = "*ghijklmno"
     * StringUtils.abbreviate("abcdefghijklmno", "'", 10, 10)   = "'ghijklmno"
     * StringUtils.abbreviate("abcdefghijklmno", "!", 12, 10)   = "!ghijklmno"
     * StringUtils.abbreviate("abcdefghij", "abra", 0, 4)       = IllegalArgumentException
     * StringUtils.abbreviate("abcdefghij", "...", 5, 6)        = IllegalArgumentException
     * </pre>
     *
     * @param abbrevMarker the String used as replacement marker
     * @param offset left edge of source String
     * @param maxWidth maximum length of result String, must be at least 4
     * @return abbreviated String, {@code null} if null String input
     * @throws IllegalArgumentException if the width is too small
     * @since 3.6
     */
    public StrEx abbreviate(final String abbrevMarker, int offset, final int maxWidth) {
        return with(StringUtils.abbreviate(str, abbrevMarker, offset, maxWidth));
    }

    /**
     * Abbreviates a String to the length passed, replacing the middle characters with the supplied
     * replacement String.
     * <p>
     * This abbreviation only occurs if the following criteria is met:
     * </p>
     * <ul>
     * <li>Neither the String for abbreviation nor the replacement String are null or empty</li>
     * <li>The length to truncate to is less than the length of the supplied String</li>
     * <li>The length to truncate to is greater than 0</li>
     * <li>The abbreviated String will have enough room for the length supplied replacement String and
     * the first and last characters of the supplied String for abbreviation</li>
     * </ul>
     * <p>
     * Otherwise, the returned String will be the same as the supplied String for abbreviation.
     * </p>
     *
     * <pre>
     * StringUtils.abbreviateMiddle(null, null, 0)      = null
     * StringUtils.abbreviateMiddle("abc", null, 0)      = "abc"
     * StringUtils.abbreviateMiddle("abc", ".", 0)      = "abc"
     * StringUtils.abbreviateMiddle("abc", ".", 3)      = "abc"
     * StringUtils.abbreviateMiddle("abcdef", ".", 4)     = "ab.f"
     * </pre>
     *
     * @param middle the String to replace the middle characters with, may be null
     * @param length the length to abbreviate {@code str} to.
     * @return the abbreviated String if the above criteria is met, or the original String supplied for
     *         abbreviation.
     * @since 2.5
     */
    public StrEx abbreviateMiddle(final String middle, final int length) {
        return with(StringUtils.abbreviateMiddle(str, middle, length));
    }

    /**
     * Appends the suffix to the end of the string if the string does not already end with any of the
     * suffixes.
     *
     * <pre>
     * StringUtils.appendIfMissing(null, null) = null
     * StringUtils.appendIfMissing("abc", null) = "abc"
     * StringUtils.appendIfMissing("", "xyz") = "xyz"
     * StringUtils.appendIfMissing("abc", "xyz") = "abcxyz"
     * StringUtils.appendIfMissing("abcxyz", "xyz") = "abcxyz"
     * StringUtils.appendIfMissing("abcXYZ", "xyz") = "abcXYZxyz"
     * </pre>
     * <p>
     * With additional suffixes,
     * </p>
     * 
     * <pre>
     * StringUtils.appendIfMissing(null, null, null) = null
     * StringUtils.appendIfMissing("abc", null, null) = "abc"
     * StringUtils.appendIfMissing("", "xyz", null) = "xyz"
     * StringUtils.appendIfMissing("abc", "xyz", new CharSequence[]{null}) = "abcxyz"
     * StringUtils.appendIfMissing("abc", "xyz", "") = "abc"
     * StringUtils.appendIfMissing("abc", "xyz", "mno") = "abcxyz"
     * StringUtils.appendIfMissing("abcxyz", "xyz", "mno") = "abcxyz"
     * StringUtils.appendIfMissing("abcmno", "xyz", "mno") = "abcmno"
     * StringUtils.appendIfMissing("abcXYZ", "xyz", "mno") = "abcXYZxyz"
     * StringUtils.appendIfMissing("abcMNO", "xyz", "mno") = "abcMNOxyz"
     * </pre>
     *
     * @param suffix The suffix to append to the end of the string.
     * @param suffixes Additional suffixes that are valid terminators.
     * @return A new String if suffix was appended, the same string otherwise.
     * @since 3.2
     */
    public StrEx appendIfMissing(final CharSequence suffix, final CharSequence... suffixes) {
        return with(StringUtils.appendIfMissing(str, suffix, suffixes));
    }

    /**
     * Appends the suffix to the end of the string if the string does not already end, case-insensitive,
     * with any of the suffixes.
     *
     * <pre>
     * StringUtils.appendIfMissingIgnoreCase(null, null) = null
     * StringUtils.appendIfMissingIgnoreCase("abc", null) = "abc"
     * StringUtils.appendIfMissingIgnoreCase("", "xyz") = "xyz"
     * StringUtils.appendIfMissingIgnoreCase("abc", "xyz") = "abcxyz"
     * StringUtils.appendIfMissingIgnoreCase("abcxyz", "xyz") = "abcxyz"
     * StringUtils.appendIfMissingIgnoreCase("abcXYZ", "xyz") = "abcXYZ"
     * </pre>
     * <p>
     * With additional suffixes,
     * </p>
     * 
     * <pre>
     * StringUtils.appendIfMissingIgnoreCase(null, null, null) = null
     * StringUtils.appendIfMissingIgnoreCase("abc", null, null) = "abc"
     * StringUtils.appendIfMissingIgnoreCase("", "xyz", null) = "xyz"
     * StringUtils.appendIfMissingIgnoreCase("abc", "xyz", new CharSequence[]{null}) = "abcxyz"
     * StringUtils.appendIfMissingIgnoreCase("abc", "xyz", "") = "abc"
     * StringUtils.appendIfMissingIgnoreCase("abc", "xyz", "mno") = "abcxyz"
     * StringUtils.appendIfMissingIgnoreCase("abcxyz", "xyz", "mno") = "abcxyz"
     * StringUtils.appendIfMissingIgnoreCase("abcmno", "xyz", "mno") = "abcmno"
     * StringUtils.appendIfMissingIgnoreCase("abcXYZ", "xyz", "mno") = "abcXYZ"
     * StringUtils.appendIfMissingIgnoreCase("abcMNO", "xyz", "mno") = "abcMNO"
     * </pre>
     *
     * @param suffix The suffix to append to the end of the string.
     * @param suffixes Additional suffixes that are valid terminators.
     * @return A new String if suffix was appended, the same string otherwise.
     * @since 3.2
     */
    public StrEx appendIfMissingIgnoreCase(final CharSequence suffix, final CharSequence... suffixes) {
        return with(StringUtils.appendIfMissingIgnoreCase(str, suffix, suffixes));
    }

    /**
     * Capitalizes a String changing the first character to title case as per
     * {@link Character#toTitleCase(int)}. No other characters are changed.
     * <p>
     * For a word based algorithm, see {org.apache.commons.text.WordUtils#capitalize(String)}. A
     * {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.capitalize(null)  = null
     * StringUtils.capitalize("")    = ""
     * StringUtils.capitalize("cat") = "Cat"
     * StringUtils.capitalize("cAt") = "CAt"
     * StringUtils.capitalize("'cat'") = "'cat'"
     * </pre>
     *
     * @return the capitalized String, {@code null} if null String input
     * @since 2.0
     */
    public StrEx capitalize() {
        return with(StringUtils.capitalize(str));
    }

    /**
     * Centers a String in a larger String of size {@code size} using the space character (' ').
     * <p>
     * If the size is less than the String length, the original String is returned. A {@code null}
     * String returns {@code null}. A negative size is treated as zero.
     * </p>
     * <p>
     * Equivalent to {@code center(str, size, " ")}.
     * </p>
     *
     * <pre>
     * StringUtils.center(null, *)   = null
     * StringUtils.center("", 4)     = "    "
     * StringUtils.center("ab", -1)  = "ab"
     * StringUtils.center("ab", 4)   = " ab "
     * StringUtils.center("abcd", 2) = "abcd"
     * StringUtils.center("a", 4)    = " a  "
     * </pre>
     *
     * @param size the int size of new String, negative treated as zero
     * @return centered String, {@code null} if null String input
     */
    public StrEx center(final int size) {
        return center(size, ' ');
    }

    /**
     * Centers a String in a larger String of size {@code size}. Uses a supplied character as the value
     * to pad the String with.
     * <p>
     * If the size is less than the String length, the String is returned. A {@code null} String returns
     * {@code null}. A negative size is treated as zero.
     * </p>
     *
     * <pre>
     * StringUtils.center(null, *, *)     = null
     * StringUtils.center("", 4, ' ')     = "    "
     * StringUtils.center("ab", -1, ' ')  = "ab"
     * StringUtils.center("ab", 4, ' ')   = " ab "
     * StringUtils.center("abcd", 2, ' ') = "abcd"
     * StringUtils.center("a", 4, ' ')    = " a  "
     * StringUtils.center("a", 4, 'y')    = "yayy"
     * </pre>
     *
     * @param size the int size of new String, negative treated as zero
     * @param padChar the character to pad the new String with
     * @return centered String, {@code null} if null String input
     * @since 2.0
     */
    public StrEx center(final int size, final char padChar) {
        return with(StringUtils.center(str, size, padChar));
    }

    /**
     * Centers a String in a larger String of size {@code size}. Uses a supplied String as the value to
     * pad the String with.
     * <p>
     * If the size is less than the String length, the String is returned. A {@code null} String returns
     * {@code null}. A negative size is treated as zero.
     * </p>
     *
     * <pre>
     * StringUtils.center(null, *, *)     = null
     * StringUtils.center("", 4, " ")     = "    "
     * StringUtils.center("ab", -1, " ")  = "ab"
     * StringUtils.center("ab", 4, " ")   = " ab "
     * StringUtils.center("abcd", 2, " ") = "abcd"
     * StringUtils.center("a", 4, " ")    = " a  "
     * StringUtils.center("a", 4, "yz")   = "yayz"
     * StringUtils.center("abc", 7, null) = "  abc  "
     * StringUtils.center("abc", 7, "")   = "  abc  "
     * </pre>
     *
     * @param size the int size of new String, negative treated as zero
     * @param padStr the String to pad the new String with, must not be null or empty
     * @return centered String, {@code null} if null String input
     * @throws IllegalArgumentException if padStr is {@code null} or empty
     */
    public StrEx center(final int size, String padStr) {
        return with(StringUtils.center(str, size, padStr));
    }

    /**
     * Removes one newline from end of a String if it's there, otherwise leave it alone. A newline is
     * &quot;{@code \n}&quot;, &quot;{@code \r}&quot;, or &quot;{@code \r\n}&quot;.
     * <p>
     * NOTE: This method changed in 2.0. It now more closely matches Perl chomp.
     * </p>
     *
     * <pre>
     * StringUtils.chomp(null)          = null
     * StringUtils.chomp("")            = ""
     * StringUtils.chomp("abc \r")      = "abc "
     * StringUtils.chomp("abc\n")       = "abc"
     * StringUtils.chomp("abc\r\n")     = "abc"
     * StringUtils.chomp("abc\r\n\r\n") = "abc\r\n"
     * StringUtils.chomp("abc\n\r")     = "abc\n"
     * StringUtils.chomp("abc\n\rabc")  = "abc\n\rabc"
     * StringUtils.chomp("\r")          = ""
     * StringUtils.chomp("\n")          = ""
     * StringUtils.chomp("\r\n")        = ""
     * </pre>
     *
     * @return String without newline, {@code null} if null String input
     */
    public StrEx chomp() {
        return with(StringUtils.chomp(str));
    }

    /**
     * Remove the last character from a String.
     * <p>
     * If the String ends in {@code \r\n}, then remove both of them.
     * </p>
     *
     * <pre>
     * StringUtils.chop(null)          = null
     * StringUtils.chop("")            = ""
     * StringUtils.chop("abc \r")      = "abc "
     * StringUtils.chop("abc\n")       = "abc"
     * StringUtils.chop("abc\r\n")     = "abc"
     * StringUtils.chop("abc")         = "ab"
     * StringUtils.chop("abc\nabc")    = "abc\nab"
     * StringUtils.chop("a")           = ""
     * StringUtils.chop("\r")          = ""
     * StringUtils.chop("\n")          = ""
     * StringUtils.chop("\r\n")        = ""
     * </pre>
     *
     * @return String without last character, {@code null} if null String input
     */
    public StrEx chop() {
        return with(StringUtils.chop(str));
    }

    /**
     * Compare two Strings lexicographically, as per {@link String#compareTo(String)}, returning :
     * <ul>
     * <li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
     * <li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
     * <li>{@code int > 0}, if {@code str1} is greater than {@code str2}</li>
     * </ul>
     * <p>
     * This is a {@code null} safe version of :
     * </p>
     * <blockquote>
     * 
     * <pre>
     * str1.compareTo(str2)
     * </pre>
     * 
     * </blockquote>
     * <p>
     * {@code null} value is considered less than non-{@code null} value. Two {@code null} references
     * are considered equal.
     * </p>
     *
     * <pre>
     * StringUtils.compare(null, null)   = 0
     * StringUtils.compare(null , "a")   &lt; 0
     * StringUtils.compare("a", null)    &gt; 0
     * StringUtils.compare("abc", "abc") = 0
     * StringUtils.compare("a", "b")     &lt; 0
     * StringUtils.compare("b", "a")     &gt; 0
     * StringUtils.compare("a", "B")     &gt; 0
     * StringUtils.compare("ab", "abc")  &lt; 0
     * </pre>
     *
     * @param str2 the String to compare to
     * @return &lt; 0, 0, &gt; 0, if {@code str1} is respectively less, equal or greater than
     *         {@code str2}
     * @see String#compareTo(String)
     * @since 3.5
     */
    public int compare(final String str2) {
        return StringUtils.compare(str, str2);
    }

    /**
     * Compare two Strings lexicographically, as per {@link String#compareTo(String)}, returning :
     * <ul>
     * <li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
     * <li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
     * <li>{@code int > 0}, if {@code str1} is greater than {@code str2}</li>
     * </ul>
     * <p>
     * This is a {@code null} safe version of :
     * </p>
     * <blockquote>
     * 
     * <pre>
     * str1.compareTo(str2)
     * </pre>
     * 
     * </blockquote>
     * <p>
     * {@code null} inputs are handled according to the {@code nullIsLess} parameter. Two {@code null}
     * references are considered equal.
     * </p>
     *
     * <pre>
     * StringUtils.compare(null, null, *)     = 0
     * StringUtils.compare(null , "a", true)  &lt; 0
     * StringUtils.compare(null , "a", false) &gt; 0
     * StringUtils.compare("a", null, true)   &gt; 0
     * StringUtils.compare("a", null, false)  &lt; 0
     * StringUtils.compare("abc", "abc", *)   = 0
     * StringUtils.compare("a", "b", *)       &lt; 0
     * StringUtils.compare("b", "a", *)       &gt; 0
     * StringUtils.compare("a", "B", *)       &gt; 0
     * StringUtils.compare("ab", "abc", *)    &lt; 0
     * </pre>
     *
     * @param str2 the String to compare to
     * @param nullIsLess whether consider {@code null} value less than non-{@code null} value
     * @return &lt; 0, 0, &gt; 0, if {@code str1} is respectively less, equal ou greater than
     *         {@code str2}
     * @see String#compareTo(String)
     * @since 3.5
     */
    public int compare(final String str2, final boolean nullIsLess) {
        return StringUtils.compare(str, str2, nullIsLess);
    }

    /**
     * Compare two Strings lexicographically, ignoring case differences, as per
     * {@link String#compareToIgnoreCase(String)}, returning :
     * <ul>
     * <li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
     * <li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
     * <li>{@code int > 0}, if {@code str1} is greater than {@code str2}</li>
     * </ul>
     * <p>
     * This is a {@code null} safe version of :
     * </p>
     * <blockquote>
     * 
     * <pre>
     * str1.compareToIgnoreCase(str2)
     * </pre>
     * 
     * </blockquote>
     * <p>
     * {@code null} value is considered less than non-{@code null} value. Two {@code null} references
     * are considered equal. Comparison is case insensitive.
     * </p>
     *
     * <pre>
     * StringUtils.compareIgnoreCase(null, null)   = 0
     * StringUtils.compareIgnoreCase(null , "a")   &lt; 0
     * StringUtils.compareIgnoreCase("a", null)    &gt; 0
     * StringUtils.compareIgnoreCase("abc", "abc") = 0
     * StringUtils.compareIgnoreCase("abc", "ABC") = 0
     * StringUtils.compareIgnoreCase("a", "b")     &lt; 0
     * StringUtils.compareIgnoreCase("b", "a")     &gt; 0
     * StringUtils.compareIgnoreCase("a", "B")     &lt; 0
     * StringUtils.compareIgnoreCase("A", "b")     &lt; 0
     * StringUtils.compareIgnoreCase("ab", "ABC")  &lt; 0
     * </pre>
     *
     * @param str2 the String to compare to
     * @return &lt; 0, 0, &gt; 0, if {@code str1} is respectively less, equal ou greater than
     *         {@code str2}, ignoring case differences.
     * @see String#compareToIgnoreCase(String)
     * @since 3.5
     */
    public int compareIgnoreCase(final String str2) {
        return StringUtils.compareIgnoreCase(str, str2);
    }

    /**
     * Compare two Strings lexicographically, ignoring case differences, as per
     * {@link String#compareToIgnoreCase(String)}, returning :
     * <ul>
     * <li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
     * <li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
     * <li>{@code int > 0}, if {@code str1} is greater than {@code str2}</li>
     * </ul>
     * <p>
     * This is a {@code null} safe version of :
     * </p>
     * <blockquote>
     * 
     * <pre>
     * str1.compareToIgnoreCase(str2)
     * </pre>
     * 
     * </blockquote>
     * <p>
     * {@code null} inputs are handled according to the {@code nullIsLess} parameter. Two {@code null}
     * references are considered equal. Comparison is case insensitive.
     * </p>
     *
     * <pre>
     * StringUtils.compareIgnoreCase(null, null, *)     = 0
     * StringUtils.compareIgnoreCase(null , "a", true)  &lt; 0
     * StringUtils.compareIgnoreCase(null , "a", false) &gt; 0
     * StringUtils.compareIgnoreCase("a", null, true)   &gt; 0
     * StringUtils.compareIgnoreCase("a", null, false)  &lt; 0
     * StringUtils.compareIgnoreCase("abc", "abc", *)   = 0
     * StringUtils.compareIgnoreCase("abc", "ABC", *)   = 0
     * StringUtils.compareIgnoreCase("a", "b", *)       &lt; 0
     * StringUtils.compareIgnoreCase("b", "a", *)       &gt; 0
     * StringUtils.compareIgnoreCase("a", "B", *)       &lt; 0
     * StringUtils.compareIgnoreCase("A", "b", *)       &lt; 0
     * StringUtils.compareIgnoreCase("ab", "abc", *)    &lt; 0
     * </pre>
     *
     * @param str2 the String to compare to
     * @param nullIsLess whether consider {@code null} value less than non-{@code null} value
     * @return &lt; 0, 0, &gt; 0, if {@code str1} is respectively less, equal ou greater than
     *         {@code str2}, ignoring case differences.
     * @see String#compareToIgnoreCase(String)
     * @since 3.5
     */
    public int compareIgnoreCase(final String str2, final boolean nullIsLess) {
        return StringUtils.compareIgnoreCase(str, str2, nullIsLess);
    }

    /**
     * Checks if CharSequence contains a search CharSequence, handling {@code null}. This method uses
     * {@link String#indexOf(String)} if possible.
     * <p>
     * A {@code null} CharSequence will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.contains(null, *)     = false
     * StringUtils.contains(*, null)     = false
     * StringUtils.contains("", "")      = true
     * StringUtils.contains("abc", "")   = true
     * StringUtils.contains("abc", "a")  = true
     * StringUtils.contains("abc", "z")  = false
     * </pre>
     *
     * @param searchSeq the CharSequence to find, may be null
     * @return true if the CharSequence contains the search CharSequence, false if not or {@code null}
     *         string input
     * @since 2.0
     * @since 3.0 Changed signature from contains(String, String) to contains(CharSequence,
     *        CharSequence)
     */
    public boolean contains(final CharSequence searchSeq) {
        return StringUtils.contains(str, searchSeq);
    }

    /**
     * Checks if CharSequence contains a search character, handling {@code null}. This method uses
     * {@link String#indexOf(int)} if possible.
     * <p>
     * A {@code null} or empty ("") CharSequence will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.contains(null, *)    = false
     * StringUtils.contains("", *)      = false
     * StringUtils.contains("abc", 'a') = true
     * StringUtils.contains("abc", 'z') = false
     * </pre>
     *
     * @param searchChar the character to find
     * @return true if the CharSequence contains the search character, false if not or {@code null}
     *         string input
     * @since 2.0
     * @since 3.0 Changed signature from contains(String, int) to contains(CharSequence, int)
     */
    public boolean contains(final int searchChar) {
        return StringUtils.contains(str, searchChar);
    }

    /**
     * Checks if the CharSequence contains any character in the given set of characters.
     * <p>
     * A {@code null} CharSequence will return {@code false}. A {@code null} or zero length search array
     * will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.containsAny(null, *)                  = false
     * StringUtils.containsAny("", *)                    = false
     * StringUtils.containsAny(*, null)                  = false
     * StringUtils.containsAny(*, [])                    = false
     * StringUtils.containsAny("zzabyycdxx", ['z', 'a']) = true
     * StringUtils.containsAny("zzabyycdxx", ['b', 'y']) = true
     * StringUtils.containsAny("zzabyycdxx", ['z', 'y']) = true
     * StringUtils.containsAny("aba", ['z'])             = false
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the {@code true} if any of the chars are found, {@code false} if no match or null input
     * @since 2.4
     * @since 3.0 Changed signature from containsAny(String, char[]) to containsAny(CharSequence,
     *        char...)
     */
    public boolean containsAny(final char... searchChars) {
        return StringUtils.containsAny(str, searchChars);
    }

    /**
     * Checks if the CharSequence contains any character in the given set of characters.
     * <p>
     * A {@code null} CharSequence will return {@code false}. A {@code null} search CharSequence will
     * return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.containsAny(null, *)               = false
     * StringUtils.containsAny("", *)                 = false
     * StringUtils.containsAny(*, null)               = false
     * StringUtils.containsAny(*, "")                 = false
     * StringUtils.containsAny("zzabyycdxx", "za")    = true
     * StringUtils.containsAny("zzabyycdxx", "by")    = true
     * StringUtils.containsAny("zzabyycdxx", "zy")    = true
     * StringUtils.containsAny("zzabyycdxx", "\tx")   = true
     * StringUtils.containsAny("zzabyycdxx", "$.#yF") = true
     * StringUtils.containsAny("aba", "z")            = false
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the {@code true} if any of the chars are found, {@code false} if no match or null input
     * @since 2.4
     * @since 3.0 Changed signature from containsAny(String, String) to containsAny(CharSequence,
     *        CharSequence)
     */
    public boolean containsAny(final CharSequence searchChars) {
        return StringUtils.containsAny(str, searchChars);
    }

    /**
     * Checks if the CharSequence contains any of the CharSequences in the given array.
     * <p>
     * A {@code null} {@code cs} CharSequence will return {@code false}. A {@code null} or zero length
     * search array will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.containsAny(null, *)            = false
     * StringUtils.containsAny("", *)              = false
     * StringUtils.containsAny(*, null)            = false
     * StringUtils.containsAny(*, [])              = false
     * StringUtils.containsAny("abcd", "ab", null) = true
     * StringUtils.containsAny("abcd", "ab", "cd") = true
     * StringUtils.containsAny("abc", "d", "abc")  = true
     * </pre>
     *
     * @param searchCharSequences The array of CharSequences to search for, may be null. Individual
     *        CharSequences may be null as well.
     * @return {@code true} if any of the search CharSequences are found, {@code false} otherwise
     * @since 3.4
     */
    public boolean containsAny(final CharSequence... searchCharSequences) {
        return StringUtils.containsAny(str, searchCharSequences);
    }

    /**
     * Checks if the CharSequence contains any of the CharSequences in the given array, ignoring case.
     * <p>
     * A {@code null} {@code cs} CharSequence will return {@code false}. A {@code null} or zero length
     * search array will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.containsAny(null, *)            = false
     * StringUtils.containsAny("", *)              = false
     * StringUtils.containsAny(*, null)            = false
     * StringUtils.containsAny(*, [])              = false
     * StringUtils.containsAny("abcd", "ab", null) = true
     * StringUtils.containsAny("abcd", "ab", "cd") = true
     * StringUtils.containsAny("abc", "d", "abc")  = true
     * StringUtils.containsAny("abc", "D", "ABC")  = true
     * StringUtils.containsAny("ABC", "d", "abc")  = true
     * </pre>
     *
     * @param searchCharSequences The array of CharSequences to search for, may be null. Individual
     *        CharSequences may be null as well.
     * @return {@code true} if any of the search CharSequences are found, {@code false} otherwise
     * @since 3.12.0
     */
    public boolean containsAnyIgnoreCase(final CharSequence... searchCharSequences) {
        return StringUtils.containsAnyIgnoreCase(str, searchCharSequences);
    }

    /**
     * Checks if CharSequence contains a search CharSequence irrespective of case, handling
     * {@code null}. Case-insensitivity is defined as by {@link String#equalsIgnoreCase(String)}.
     * <p>
     * A {@code null} CharSequence will return {@code false}.
     *
     * <pre>
     * StringUtils.containsIgnoreCase(null, *) = false
     * StringUtils.containsIgnoreCase(*, null) = false
     * StringUtils.containsIgnoreCase("", "") = true
     * StringUtils.containsIgnoreCase("abc", "") = true
     * StringUtils.containsIgnoreCase("abc", "a") = true
     * StringUtils.containsIgnoreCase("abc", "z") = false
     * StringUtils.containsIgnoreCase("abc", "A") = true
     * StringUtils.containsIgnoreCase("abc", "Z") = false
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @return true if the CharSequence contains the search CharSequence irrespective of case or false
     *         if not or {@code null} string input
     * @since 3.0 Changed signature from containsIgnoreCase(String, String) to
     *        containsIgnoreCase(CharSequence, CharSequence)
     */
    public boolean containsIgnoreCase(final CharSequence searchStr) {
        return StringUtils.containsIgnoreCase(str, searchStr);
    }

    /**
     * Checks that the CharSequence does not contain certain characters.
     * <p>
     * A {@code null} CharSequence will return {@code true}. A {@code null} invalid character array will
     * return {@code true}. An empty CharSequence (length()=0) always returns true.
     * </p>
     *
     * <pre>
     * StringUtils.containsNone(null, *)       = true
     * StringUtils.containsNone(*, null)       = true
     * StringUtils.containsNone("", *)         = true
     * StringUtils.containsNone("ab", '')      = true
     * StringUtils.containsNone("abab", 'xyz') = true
     * StringUtils.containsNone("ab1", 'xyz')  = true
     * StringUtils.containsNone("abz", 'xyz')  = false
     * </pre>
     *
     * @param searchChars an array of invalid chars, may be null
     * @return true if it contains none of the invalid chars, or is null
     * @since 2.0
     * @since 3.0 Changed signature from containsNone(String, char[]) to containsNone(CharSequence,
     *        char...)
     */
    public boolean containsNone(final char... searchChars) {
        return StringUtils.containsNone(str, searchChars);
    }

    /**
     * Checks that the CharSequence does not contain certain characters.
     * <p>
     * A {@code null} CharSequence will return {@code true}. A {@code null} invalid character array will
     * return {@code true}. An empty String ("") always returns true.
     * </p>
     *
     * <pre>
     * StringUtils.containsNone(null, *)       = true
     * StringUtils.containsNone(*, null)       = true
     * StringUtils.containsNone("", *)         = true
     * StringUtils.containsNone("ab", "")      = true
     * StringUtils.containsNone("abab", "xyz") = true
     * StringUtils.containsNone("ab1", "xyz")  = true
     * StringUtils.containsNone("abz", "xyz")  = false
     * </pre>
     *
     * @param invalidChars a String of invalid chars, may be null
     * @return true if it contains none of the invalid chars, or is null
     * @since 2.0
     * @since 3.0 Changed signature from containsNone(String, String) to containsNone(CharSequence,
     *        String)
     */
    public boolean containsNone(final String invalidChars) {
        return StringUtils.containsNone(str, invalidChars);
    }

    /**
     * Checks if the CharSequence contains only certain characters.
     * <p>
     * A {@code null} CharSequence will return {@code false}. A {@code null} valid character array will
     * return {@code false}. An empty CharSequence (length()=0) always returns {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.containsOnly(null, *)       = false
     * StringUtils.containsOnly(*, null)       = false
     * StringUtils.containsOnly("", *)         = true
     * StringUtils.containsOnly("ab", '')      = false
     * StringUtils.containsOnly("abab", 'abc') = true
     * StringUtils.containsOnly("ab1", 'abc')  = false
     * StringUtils.containsOnly("abz", 'abc')  = false
     * </pre>
     *
     * @param valid an array of valid chars, may be null
     * @return true if it only contains valid chars and is non-null
     * @since 3.0 Changed signature from containsOnly(String, char[]) to containsOnly(CharSequence,
     *        char...)
     */
    public boolean containsOnly(final char... valid) {
        return StringUtils.containsOnly(str, valid);
    }

    /**
     * Checks if the CharSequence contains only certain characters.
     * <p>
     * A {@code null} CharSequence will return {@code false}. A {@code null} valid character String will
     * return {@code false}. An empty String (length()=0) always returns {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.containsOnly(null, *)       = false
     * StringUtils.containsOnly(*, null)       = false
     * StringUtils.containsOnly("", *)         = true
     * StringUtils.containsOnly("ab", "")      = false
     * StringUtils.containsOnly("abab", "abc") = true
     * StringUtils.containsOnly("ab1", "abc")  = false
     * StringUtils.containsOnly("abz", "abc")  = false
     * </pre>
     *
     * @param validChars a String of valid chars, may be null
     * @return true if it only contains valid chars and is non-null
     * @since 2.0
     * @since 3.0 Changed signature from containsOnly(String, String) to containsOnly(CharSequence,
     *        String)
     */
    public boolean containsOnly(final String validChars) {
        return StringUtils.containsOnly(str, validChars);
    }

    /**
     * Check whether the given CharSequence contains any whitespace characters.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     *
     * @return {@code true} if the CharSequence is not empty and contains at least 1 (breaking)
     *         whitespace character
     * @since 3.0
     */
    // From org.springframework.util.StringUtils, under Apache License 2.0
    public boolean containsWhitespace() {
        return StringUtils.containsWhitespace(str);
    }

    /**
     * Counts how many times the char appears in the given string.
     * <p>
     * A {@code null} or empty ("") String input returns {@code 0}.
     * </p>
     *
     * <pre>
     * StringUtils.countMatches(null, *)       = 0
     * StringUtils.countMatches("", *)         = 0
     * StringUtils.countMatches("abba", 0)  = 0
     * StringUtils.countMatches("abba", 'a')   = 2
     * StringUtils.countMatches("abba", 'b')  = 2
     * StringUtils.countMatches("abba", 'x') = 0
     * </pre>
     *
     * @param ch the char to count
     * @return the number of occurrences, 0 if the CharSequence is {@code null}
     * @since 3.4
     */
    public int countMatches(final char ch) {
        return StringUtils.countMatches(str, ch);
    }

    /**
     * Counts how many times the substring appears in the larger string. Note that the code only counts
     * non-overlapping matches.
     * <p>
     * A {@code null} or empty ("") String input returns {@code 0}.
     * </p>
     *
     * <pre>
     * StringUtils.countMatches(null, *)       = 0
     * StringUtils.countMatches("", *)         = 0
     * StringUtils.countMatches("abba", null)  = 0
     * StringUtils.countMatches("abba", "")    = 0
     * StringUtils.countMatches("abba", "a")   = 2
     * StringUtils.countMatches("abba", "ab")  = 1
     * StringUtils.countMatches("abba", "xxx") = 0
     * StringUtils.countMatches("ababa", "aba") = 1
     * </pre>
     *
     * @param sub the substring to count, may be null
     * @return the number of occurrences, 0 if either CharSequence is {@code null}
     * @since 3.0 Changed signature from countMatches(String, String) to countMatches(CharSequence,
     *        CharSequence)
     */
    public int countMatches(final CharSequence sub) {
        return StringUtils.countMatches(str, sub);
    }

    /**
     * Returns either the passed in CharSequence, or if the CharSequence is whitespace, empty ("") or
     * {@code null}, the value of {@code defaultStr}.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.defaultIfBlank(null, "NULL")  = "NULL"
     * StringUtils.defaultIfBlank("", "NULL")    = "NULL"
     * StringUtils.defaultIfBlank(" ", "NULL")   = "NULL"
     * StringUtils.defaultIfBlank("bat", "NULL") = "bat"
     * StringUtils.defaultIfBlank("", null)      = null
     * </pre>
     *
     * @param defaultStr the default CharSequence to return if the input is whitespace, empty ("") or
     *        {@code null}, may be null
     * @return the passed in CharSequence, or the default
     * @see StringUtils#defaultString(String, String)
     */
    public StrEx defaultIfBlank(final String defaultStr) {
        return with(StringUtils.defaultIfBlank(str, defaultStr));
    }

    /**
     * Returns either the passed in CharSequence, or if the CharSequence is empty or {@code null}, the
     * value of {@code defaultStr}.
     *
     * <pre>
     * StringUtils.defaultIfEmpty(null, "NULL")  = "NULL"
     * StringUtils.defaultIfEmpty("", "NULL")    = "NULL"
     * StringUtils.defaultIfEmpty(" ", "NULL")   = " "
     * StringUtils.defaultIfEmpty("bat", "NULL") = "bat"
     * StringUtils.defaultIfEmpty("", null)      = null
     * </pre>
     *
     * @param defaultStr the default CharSequence to return if the input is empty ("") or {@code null},
     *        may be null
     * @return the passed in CharSequence, or the default
     * @see StringUtils#defaultString(String, String)
     */
    public StrEx defaultIfEmpty(final String defaultStr) {
        return with(StringUtils.defaultIfEmpty(str, defaultStr));
    }

    /**
     * Returns either the passed in String, or if the String is {@code null}, an empty String ("").
     *
     * <pre>
     * StringUtils.defaultString(null)  = ""
     * StringUtils.defaultString("")    = ""
     * StringUtils.defaultString("bat") = "bat"
     * </pre>
     *
     * @return the passed in String, or the empty String if it was {@code null}
     * @see Objects#toString(Object, String)
     * @see String#valueOf(Object)
     */
    public StrEx defaultString() {
        return with(Objects.toString(str, EMPTY));
    }

    /**
     * Deletes all whitespaces from a String as defined by {@link Character#isWhitespace(char)}.
     *
     * <pre>
     * StringUtils.deleteWhitespace(null)         = null
     * StringUtils.deleteWhitespace("")           = ""
     * StringUtils.deleteWhitespace("abc")        = "abc"
     * StringUtils.deleteWhitespace("   ab  c  ") = "abc"
     * </pre>
     *
     * @return the String without whitespaces, {@code null} if null String input
     */
    public StrEx deleteWhitespace() {
        return with(StringUtils.deleteWhitespace(str));
    }

    /**
     * Compares two Strings, and returns the portion where they differ. More precisely, return the
     * remainder of the second String, starting from where it's different from the first. This means
     * that the difference between "abc" and "ab" is the empty String and not "c".
     * <p>
     * For example, {@code difference("i am a machine", "i am a robot") -> "robot"}.
     * </p>
     *
     * <pre>
     * StringUtils.difference(null, null) = null
     * StringUtils.difference("", "") = ""
     * StringUtils.difference("", "abc") = "abc"
     * StringUtils.difference("abc", "") = ""
     * StringUtils.difference("abc", "abc") = ""
     * StringUtils.difference("abc", "ab") = ""
     * StringUtils.difference("ab", "abxyz") = "xyz"
     * StringUtils.difference("abcde", "abxyz") = "xyz"
     * StringUtils.difference("abcde", "xyz") = "xyz"
     * </pre>
     *
     * @param str2 the second String, may be null
     * @return the portion of str2 where it differs from str1; returns the empty String if they are
     *         equal
     * @since 2.0
     */
    public StrEx difference(final String str2) {
        return with(StringUtils.difference(str, str2));
    }

    /**
     * Check if a CharSequence ends with a specified suffix.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered to be
     * equal. The comparison is case-sensitive.
     * </p>
     *
     * <pre>
     * StringUtils.endsWith(null, null)      = true
     * StringUtils.endsWith(null, "def")     = false
     * StringUtils.endsWith("abcdef", null)  = false
     * StringUtils.endsWith("abcdef", "def") = true
     * StringUtils.endsWith("ABCDEF", "def") = false
     * StringUtils.endsWith("ABCDEF", "cde") = false
     * StringUtils.endsWith("ABCDEF", "")    = true
     * </pre>
     *
     * @param suffix the suffix to find, may be null
     * @return {@code true} if the CharSequence ends with the suffix, case-sensitive, or both
     *         {@code null}
     * @see String#endsWith(String)
     * @since 2.4
     * @since 3.0 Changed signature from endsWith(String, String) to endsWith(CharSequence,
     *        CharSequence)
     */
    public boolean endsWith(final CharSequence suffix) {
        return StringUtils.endsWith(str, suffix);
    }

    /**
     * Check if a CharSequence ends with any of the provided case-sensitive suffixes.
     *
     * <pre>
     * StringUtils.endsWithAny(null, null)      = false
     * StringUtils.endsWithAny(null, new String[] {"abc"})  = false
     * StringUtils.endsWithAny("abcxyz", null)     = false
     * StringUtils.endsWithAny("abcxyz", new String[] {""}) = true
     * StringUtils.endsWithAny("abcxyz", new String[] {"xyz"}) = true
     * StringUtils.endsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true
     * StringUtils.endsWithAny("abcXYZ", "def", "XYZ") = true
     * StringUtils.endsWithAny("abcXYZ", "def", "xyz") = false
     * </pre>
     *
     * @param searchStrings the case-sensitive CharSequences to find, may be empty or contain
     *        {@code null}
     * @return {@code true} if the input {@code sequence} is {@code null} AND no {@code searchStrings}
     *         are provided, or the input {@code sequence} ends in any of the provided case-sensitive
     *         {@code searchStrings}.
     * @see StringUtils#endsWith(CharSequence, CharSequence)
     * @since 3.0
     */
    public boolean endsWithAny(final CharSequence... searchStrings) {
        return StringUtils.endsWithAny(str, searchStrings);
    }

    /**
     * Case insensitive check if a CharSequence ends with a specified suffix.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered to be
     * equal. The comparison is case insensitive.
     * </p>
     *
     * <pre>
     * StringUtils.endsWithIgnoreCase(null, null)      = true
     * StringUtils.endsWithIgnoreCase(null, "def")     = false
     * StringUtils.endsWithIgnoreCase("abcdef", null)  = false
     * StringUtils.endsWithIgnoreCase("abcdef", "def") = true
     * StringUtils.endsWithIgnoreCase("ABCDEF", "def") = true
     * StringUtils.endsWithIgnoreCase("ABCDEF", "cde") = false
     * </pre>
     *
     * @param suffix the suffix to find, may be null
     * @return {@code true} if the CharSequence ends with the suffix, case-insensitive, or both
     *         {@code null}
     * @see String#endsWith(String)
     * @since 2.4
     * @since 3.0 Changed signature from endsWithIgnoreCase(String, String) to
     *        endsWithIgnoreCase(CharSequence, CharSequence)
     */
    public boolean endsWithIgnoreCase(final CharSequence suffix) {
        return StringUtils.endsWithIgnoreCase(str, suffix);
    }

    /**
     * Compares two CharSequences, returning {@code true} if they represent equal sequences of
     * characters.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered to be
     * equal. The comparison is <strong>case-sensitive</strong>.
     * </p>
     *
     * <pre>
     * StringUtils.equals(null, null)   = true
     * StringUtils.equals(null, "abc")  = false
     * StringUtils.equals("abc", null)  = false
     * StringUtils.equals("abc", "abc") = true
     * StringUtils.equals("abc", "ABC") = false
     * </pre>
     *
     * @param cs2 the second CharSequence, may be {@code null}
     * @return {@code true} if the CharSequences are equal (case-sensitive), or both {@code null}
     * @see Object#equals(Object)
     * @since 3.0 Changed signature from equals(String, String) to equals(CharSequence, CharSequence)
     */
    public boolean equals(final CharSequence cs2) {
        return StringUtils.equals(str, cs2);
    }

    public boolean equals(final StrEx cs2) {
        return StringUtils.equals(str, cs2 == null ? null : cs2.toS());
    }

    /**
     * Compares given {@code string} to a CharSequences vararg of {@code searchStrings}, returning
     * {@code true} if the {@code string} is equal to any of the {@code searchStrings}.
     *
     * <pre>
     * StringUtils.equalsAny(null, (CharSequence[]) null) = false
     * StringUtils.equalsAny(null, null, null)    = true
     * StringUtils.equalsAny(null, "abc", "def")  = false
     * StringUtils.equalsAny("abc", null, "def")  = false
     * StringUtils.equalsAny("abc", "abc", "def") = true
     * StringUtils.equalsAny("abc", "ABC", "DEF") = false
     * </pre>
     *
     * @param searchStrings a vararg of strings, may be {@code null}.
     * @return {@code true} if the string is equal (case-sensitive) to any other element of
     *         {@code searchStrings}; {@code false} if {@code searchStrings} is null or contains no
     *         matches.
     * @since 3.5
     */
    public boolean equalsAny(final CharSequence... searchStrings) {
        return StringUtils.equalsAny(str, searchStrings);
    }

    /**
     * Compares given {@code string} to a CharSequences vararg of {@code searchStrings}, returning
     * {@code true} if the {@code string} is equal to any of the {@code searchStrings}, ignoring case.
     *
     * <pre>
     * StringUtils.equalsAnyIgnoreCase(null, (CharSequence[]) null) = false
     * StringUtils.equalsAnyIgnoreCase(null, null, null)    = true
     * StringUtils.equalsAnyIgnoreCase(null, "abc", "def")  = false
     * StringUtils.equalsAnyIgnoreCase("abc", null, "def")  = false
     * StringUtils.equalsAnyIgnoreCase("abc", "abc", "def") = true
     * StringUtils.equalsAnyIgnoreCase("abc", "ABC", "DEF") = true
     * </pre>
     *
     * @param searchStrings a vararg of strings, may be {@code null}.
     * @return {@code true} if the string is equal (case-insensitive) to any other element of
     *         {@code searchStrings}; {@code false} if {@code searchStrings} is null or contains no
     *         matches.
     * @since 3.5
     */
    public boolean equalsAnyIgnoreCase(final CharSequence... searchStrings) {
        return StringUtils.equalsAnyIgnoreCase(str, searchStrings);
    }

    /**
     * Compares two CharSequences, returning {@code true} if they represent equal sequences of
     * characters, ignoring case.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered equal.
     * The comparison is <strong>case insensitive</strong>.
     * </p>
     *
     * <pre>
     * StringUtils.equalsIgnoreCase(null, null)   = true
     * StringUtils.equalsIgnoreCase(null, "abc")  = false
     * StringUtils.equalsIgnoreCase("abc", null)  = false
     * StringUtils.equalsIgnoreCase("abc", "abc") = true
     * StringUtils.equalsIgnoreCase("abc", "ABC") = true
     * </pre>
     *
     * @param cs2 the second CharSequence, may be {@code null}
     * @return {@code true} if the CharSequences are equal (case-insensitive), or both {@code null}
     * @since 3.0 Changed signature from equalsIgnoreCase(String, String) to
     *        equalsIgnoreCase(CharSequence, CharSequence)
     */
    public boolean equalsIgnoreCase(final CharSequence cs2) {
        return StringUtils.equalsIgnoreCase(str, cs2);
    }

    /**
     * Calls {@link String#getBytes(Charset)} in a null-safe manner.
     *
     * @param charset The {@link Charset} to encode the {@link String}. If null, then use the default
     *        Charset.
     * @return The empty byte[] if {@code string} is null, the result of
     *         {@link String#getBytes(Charset)} otherwise.
     * @see String#getBytes(Charset)
     * @since 3.10
     */
    public byte[] getBytes(final Charset charset) {
        return StringUtils.getBytes(str, charset);
    }

    /**
     * Calls {@link String#getBytes(String)} in a null-safe manner.
     *
     * @param charset The {@link Charset} name to encode the {@link String}. If null, then use the
     *        default Charset.
     * @return The empty byte[] if {@code string} is null, the result of {@link String#getBytes(String)}
     *         otherwise.
     * @throws UnsupportedEncodingException Thrown when the named charset is not supported.
     * @see String#getBytes(String)
     * @since 3.10
     */
    public byte[] getBytes(final String charset) throws UnsupportedEncodingException {
        return StringUtils.getBytes(str, charset);
    }

    /**
     * Checks if a String {@code str} contains Unicode digits, if yes then concatenate all the digits in
     * {@code str} and return it as a String.
     * <p>
     * An empty ("") String will be returned if no digits found in {@code str}.
     * </p>
     *
     * <pre>
     * StringUtils.getDigits(null)  = null
     * StringUtils.getDigits("")    = ""
     * StringUtils.getDigits("abc") = ""
     * StringUtils.getDigits("1000$") = "1000"
     * StringUtils.getDigits("1123~45") = "112345"
     * StringUtils.getDigits("(541) 754-3010") = "5417543010"
     * StringUtils.getDigits("\u0967\u0968\u0969") = "\u0967\u0968\u0969"
     * </pre>
     *
     * @return String with only digits, or an empty ("") String if no digits found, or {@code null}
     *         String if {@code str} is null
     * @since 3.6
     */
    public StrEx getDigits() {
        return with(StringUtils.getDigits(str));
    }

    /**
     * Returns either the passed in CharSequence, or if the CharSequence is whitespace, empty ("") or
     * {@code null}, the value supplied by {@code defaultStrSupplier}.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     * <p>
     * Caller responsible for thread-safety and exception handling of default value supplier
     * </p>
     *
     * <pre>
     * {@code
     * StringUtils.getIfBlank(null, () -> "NULL")   = "NULL"
     * StringUtils.getIfBlank("", () -> "NULL")     = "NULL"
     * StringUtils.getIfBlank(" ", () -> "NULL")    = "NULL"
     * StringUtils.getIfBlank("bat", () -> "NULL")  = "bat"
     * StringUtils.getIfBlank("", () -> null)       = null
     * StringUtils.getIfBlank("", null)             = null
     * }</pre>
     *
     * @param defaultSupplier the supplier of default CharSequence to return if the input is whitespace,
     *        empty ("") or {@code null}, may be null
     * @return the passed in CharSequence, or the default
     * @see StringUtils#defaultString(String, String)
     * @since 3.10
     */
    public StrEx getIfBlank(final Supplier<String> defaultSupplier) {
        return with(StringUtils.getIfBlank(str, defaultSupplier));
    }

    /**
     * Returns either the passed in CharSequence, or if the CharSequence is empty or {@code null}, the
     * value supplied by {@code defaultStrSupplier}.
     * <p>
     * Caller responsible for thread-safety and exception handling of default value supplier
     * </p>
     *
     * <pre>
     * {@code
     * StringUtils.getIfEmpty(null, () -> "NULL")    = "NULL"
     * StringUtils.getIfEmpty("", () -> "NULL")      = "NULL"
     * StringUtils.getIfEmpty(" ", () -> "NULL")     = " "
     * StringUtils.getIfEmpty("bat", () -> "NULL")   = "bat"
     * StringUtils.getIfEmpty("", () -> null)        = null
     * StringUtils.getIfEmpty("", null)              = null
     * }
     * </pre>
     *
     * @param defaultSupplier the supplier of default CharSequence to return if the input is empty ("")
     *        or {@code null}, may be null
     * @return the passed in CharSequence, or the default
     * @see StringUtils#defaultString(String, String)
     * @since 3.10
     */
    public StrEx getIfEmpty(final Supplier<String> defaultSupplier) {
        return with(StringUtils.getIfEmpty(str, defaultSupplier));
    }

    /**
     * Finds the first index within a CharSequence, handling {@code null}. This method uses
     * {@link String#indexOf(String, int)} if possible.
     * <p>
     * A {@code null} CharSequence will return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOf(null, *)          = -1
     * StringUtils.indexOf(*, null)          = -1
     * StringUtils.indexOf("", "")           = 0
     * StringUtils.indexOf("", *)            = -1 (except when * = "")
     * StringUtils.indexOf("aabaabaa", "a")  = 0
     * StringUtils.indexOf("aabaabaa", "b")  = 2
     * StringUtils.indexOf("aabaabaa", "ab") = 1
     * StringUtils.indexOf("aabaabaa", "")   = 0
     * </pre>
     *
     * @param searchSeq the CharSequence to find, may be null
     * @return the first index of the search CharSequence, -1 if no match or {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from indexOf(String, String) to indexOf(CharSequence, CharSequence)
     */
    public int indexOf(final CharSequence searchSeq) {
        return StringUtils.indexOf(str, searchSeq);
    }

    /**
     * Finds the first index within a CharSequence, handling {@code null}. This method uses
     * {@link String#indexOf(String, int)} if possible.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position is treated as zero.
     * An empty ("") search CharSequence always matches. A start position greater than the string length
     * only matches an empty search CharSequence.
     * </p>
     *
     * <pre>
     * StringUtils.indexOf(null, *, *)          = -1
     * StringUtils.indexOf(*, null, *)          = -1
     * StringUtils.indexOf("", "", 0)           = 0
     * StringUtils.indexOf("", *, 0)            = -1 (except when * = "")
     * StringUtils.indexOf("aabaabaa", "a", 0)  = 0
     * StringUtils.indexOf("aabaabaa", "b", 0)  = 2
     * StringUtils.indexOf("aabaabaa", "ab", 0) = 1
     * StringUtils.indexOf("aabaabaa", "b", 3)  = 5
     * StringUtils.indexOf("aabaabaa", "b", 9)  = -1
     * StringUtils.indexOf("aabaabaa", "b", -1) = 2
     * StringUtils.indexOf("aabaabaa", "", 2)   = 2
     * StringUtils.indexOf("abc", "", 9)        = 3
     * </pre>
     *
     * @param searchSeq the CharSequence to find, may be null
     * @param startPos the start position, negative treated as zero
     * @return the first index of the search CharSequence (always &ge; startPos), -1 if no match or
     *         {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from indexOf(String, String, int) to indexOf(CharSequence,
     *        CharSequence, int)
     */
    public int indexOf(final CharSequence searchSeq, final int startPos) {
        return StringUtils.indexOf(str, searchSeq, startPos);
    }

    /**
     * Returns the index within {@code seq} of the first occurrence of the specified character. If a
     * character with value {@code searchChar} occurs in the character sequence represented by
     * {@code seq} {@link CharSequence} object, then the index (in Unicode code units) of the first such
     * occurrence is returned. For values of {@code searchChar} in the range from 0 to 0xFFFF
     * (inclusive), this is the smallest value <i>k</i> such that: <blockquote>
     * 
     * <pre>
     * this.charAt(<i>k</i>) == searchChar
     * </pre>
     * 
     * </blockquote> is true. For other values of {@code searchChar}, it is the smallest value <i>k</i>
     * such that: <blockquote>
     * 
     * <pre>
     * this.codePointAt(<i>k</i>) == searchChar
     * </pre>
     * 
     * </blockquote> is true. In either case, if no such character occurs in {@code seq}, then
     * {@code INDEX_NOT_FOUND (-1)} is returned.
     * <p>
     * Furthermore, a {@code null} or empty ("") CharSequence will return {@code INDEX_NOT_FOUND (-1)}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOf(null, *)         = -1
     * StringUtils.indexOf("", *)           = -1
     * StringUtils.indexOf("aabaabaa", 'a') = 0
     * StringUtils.indexOf("aabaabaa", 'b') = 2
     * </pre>
     *
     * @param searchChar the character to find
     * @return the first index of the search character, -1 if no match or {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from indexOf(String, int) to indexOf(CharSequence, int)
     * @since 3.6 Updated {@link CharSequenceUtils} call to behave more like {@link String}
     */
    public int indexOf(final int searchChar) {
        return StringUtils.indexOf(str, searchChar);
    }

    /**
     * Returns the index within {@code seq} of the first occurrence of the specified character, starting
     * the search at the specified index.
     * <p>
     * If a character with value {@code searchChar} occurs in the character sequence represented by the
     * {@code seq} {@link CharSequence} object at an index no smaller than {@code startPos}, then the
     * index of the first such occurrence is returned. For values of {@code searchChar} in the range
     * from 0 to 0xFFFF (inclusive), this is the smallest value <i>k</i> such that: <blockquote>
     * 
     * <pre>
     * (this.charAt(<i>k</i>) == searchChar) &amp;&amp; (<i>k</i> &gt;= startPos)
     * </pre>
     * 
     * </blockquote> is true. For other values of {@code searchChar}, it is the smallest value <i>k</i>
     * such that: <blockquote>
     * 
     * <pre>
     * (this.codePointAt(<i>k</i>) == searchChar) &amp;&amp; (<i>k</i> &gt;= startPos)
     * </pre>
     * 
     * </blockquote> is true. In either case, if no such character occurs in {@code seq} at or after
     * position {@code startPos}, then {@code -1} is returned.
     * <p>
     * There is no restriction on the value of {@code startPos}. If it is negative, it has the same
     * effect as if it were zero: this entire string may be searched. If it is greater than the length
     * of this string, it has the same effect as if it were equal to the length of this string:
     * {@code (INDEX_NOT_FOUND) -1} is returned. Furthermore, a {@code null} or empty ("") CharSequence
     * will return {@code (INDEX_NOT_FOUND) -1}.
     * <p>
     * All indices are specified in {@code char} values (Unicode code units).
     *
     * <pre>
     * StringUtils.indexOf(null, *, *)          = -1
     * StringUtils.indexOf("", *, *)            = -1
     * StringUtils.indexOf("aabaabaa", 'b', 0)  = 2
     * StringUtils.indexOf("aabaabaa", 'b', 3)  = 5
     * StringUtils.indexOf("aabaabaa", 'b', 9)  = -1
     * StringUtils.indexOf("aabaabaa", 'b', -1) = 2
     * </pre>
     *
     * @param searchChar the character to find
     * @param startPos the start position, negative treated as zero
     * @return the first index of the search character (always &ge; startPos), -1 if no match or
     *         {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from indexOf(String, int, int) to indexOf(CharSequence, int, int)
     * @since 3.6 Updated {@link CharSequenceUtils} call to behave more like {@link String}
     */
    public int indexOf(final int searchChar, final int startPos) {
        return StringUtils.indexOf(str, searchChar, startPos);
    }

    /**
     * Search a CharSequence to find the first index of any character in the given set of characters.
     * <p>
     * A {@code null} String will return {@code -1}. A {@code null} or zero length search array will
     * return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfAny(null, *)                  = -1
     * StringUtils.indexOfAny("", *)                    = -1
     * StringUtils.indexOfAny(*, null)                  = -1
     * StringUtils.indexOfAny(*, [])                    = -1
     * StringUtils.indexOfAny("zzabyycdxx", ['z', 'a']) = 0
     * StringUtils.indexOfAny("zzabyycdxx", ['b', 'y']) = 3
     * StringUtils.indexOfAny("aba", ['z'])             = -1
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the index of any of the chars, -1 if no match or null input
     * @since 2.0
     * @since 3.0 Changed signature from indexOfAny(String, char[]) to indexOfAny(CharSequence, char...)
     */
    public int indexOfAny(final char... searchChars) {
        return StringUtils.indexOfAny(str, searchChars);
    }

    /**
     * Find the first index of any of a set of potential substrings.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A {@code null} or zero length search array
     * will return {@code -1}. A {@code null} search array entry will be ignored, but a search array
     * containing "" will return {@code 0} if {@code str} is not null. This method uses
     * {@link String#indexOf(String)} if possible.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfAny(null, *)                      = -1
     * StringUtils.indexOfAny(*, null)                      = -1
     * StringUtils.indexOfAny(*, [])                        = -1
     * StringUtils.indexOfAny("zzabyycdxx", ["ab", "cd"])   = 2
     * StringUtils.indexOfAny("zzabyycdxx", ["cd", "ab"])   = 2
     * StringUtils.indexOfAny("zzabyycdxx", ["mn", "op"])   = -1
     * StringUtils.indexOfAny("zzabyycdxx", ["zab", "aby"]) = 1
     * StringUtils.indexOfAny("zzabyycdxx", [""])           = 0
     * StringUtils.indexOfAny("", [""])                     = 0
     * StringUtils.indexOfAny("", ["a"])                    = -1
     * </pre>
     *
     * @param searchStrs the CharSequences to search for, may be null
     * @return the first index of any of the searchStrs in str, -1 if no match
     * @since 3.0 Changed signature from indexOfAny(String, String[]) to indexOfAny(CharSequence,
     *        CharSequence...)
     */
    public int indexOfAny(final CharSequence... searchStrs) {
        return StringUtils.indexOfAny(str, searchStrs);
    }

    /**
     * Search a CharSequence to find the first index of any character in the given set of characters.
     * <p>
     * A {@code null} String will return {@code -1}. A {@code null} search string will return
     * {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfAny(null, *)            = -1
     * StringUtils.indexOfAny("", *)              = -1
     * StringUtils.indexOfAny(*, null)            = -1
     * StringUtils.indexOfAny(*, "")              = -1
     * StringUtils.indexOfAny("zzabyycdxx", "za") = 0
     * StringUtils.indexOfAny("zzabyycdxx", "by") = 3
     * StringUtils.indexOfAny("aba", "z")         = -1
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the index of any of the chars, -1 if no match or null input
     * @since 2.0
     * @since 3.0 Changed signature from indexOfAny(String, String) to indexOfAny(CharSequence, String)
     */
    public int indexOfAny(final String searchChars) {
        return StringUtils.indexOfAny(str, searchChars);
    }

    /**
     * Searches a CharSequence to find the first index of any character not in the given set of
     * characters.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A {@code null} or zero length search array
     * will return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfAnyBut(null, *)                              = -1
     * StringUtils.indexOfAnyBut("", *)                                = -1
     * StringUtils.indexOfAnyBut(*, null)                              = -1
     * StringUtils.indexOfAnyBut(*, [])                                = -1
     * StringUtils.indexOfAnyBut("zzabyycdxx", new char[] {'z', 'a'} ) = 3
     * StringUtils.indexOfAnyBut("aba", new char[] {'z'} )             = 0
     * StringUtils.indexOfAnyBut("aba", new char[] {'a', 'b'} )        = -1
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the index of any of the chars, -1 if no match or null input
     * @since 2.0
     * @since 3.0 Changed signature from indexOfAnyBut(String, char[]) to indexOfAnyBut(CharSequence,
     *        char...)
     */
    public int indexOfAnyBut(final char... searchChars) {
        return StringUtils.indexOfAnyBut(str, searchChars);
    }

    /**
     * Search a CharSequence to find the first index of any character not in the given set of
     * characters.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A {@code null} or empty search string will
     * return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfAnyBut(null, *)            = -1
     * StringUtils.indexOfAnyBut("", *)              = -1
     * StringUtils.indexOfAnyBut(*, null)            = -1
     * StringUtils.indexOfAnyBut(*, "")              = -1
     * StringUtils.indexOfAnyBut("zzabyycdxx", "za") = 3
     * StringUtils.indexOfAnyBut("zzabyycdxx", "")   = -1
     * StringUtils.indexOfAnyBut("aba", "ab")        = -1
     * </pre>
     *
     * @param searchChars the chars to search for, may be null
     * @return the index of any of the chars, -1 if no match or null input
     * @since 2.0
     * @since 3.0 Changed signature from indexOfAnyBut(String, String) to indexOfAnyBut(CharSequence,
     *        CharSequence)
     */
    public int indexOfAnyBut(final CharSequence searchChars) {
        return StringUtils.indexOfAnyBut(str, searchChars);
    }

    /**
     * Compares two CharSequences, and returns the index at which the CharSequences begin to differ.
     * <p>
     * For example, {@code indexOfDifference("i am a machine", "i am a robot") -> 7}
     * </p>
     *
     * <pre>
     * StringUtils.indexOfDifference(null, null) = -1
     * StringUtils.indexOfDifference("", "") = -1
     * StringUtils.indexOfDifference("", "abc") = 0
     * StringUtils.indexOfDifference("abc", "") = 0
     * StringUtils.indexOfDifference("abc", "abc") = -1
     * StringUtils.indexOfDifference("ab", "abxyz") = 2
     * StringUtils.indexOfDifference("abcde", "abxyz") = 2
     * StringUtils.indexOfDifference("abcde", "xyz") = 0
     * </pre>
     *
     * @param cs2 the second CharSequence, may be null
     * @return the index where cs1 and cs2 begin to differ; -1 if they are equal
     * @since 2.0
     * @since 3.0 Changed signature from indexOfDifference(String, String) to
     *        indexOfDifference(CharSequence, CharSequence)
     */
    public int indexOfDifference(final CharSequence cs2) {
        return StringUtils.indexOfDifference(str, cs2);
    }

    /**
     * Case in-sensitive find of the first index within a CharSequence.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position is treated as zero.
     * An empty ("") search CharSequence always matches. A start position greater than the string length
     * only matches an empty search CharSequence.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfIgnoreCase(null, *)          = -1
     * StringUtils.indexOfIgnoreCase(*, null)          = -1
     * StringUtils.indexOfIgnoreCase("", "")           = 0
     * StringUtils.indexOfIgnoreCase(" ", " ")         = 0
     * StringUtils.indexOfIgnoreCase("aabaabaa", "a")  = 0
     * StringUtils.indexOfIgnoreCase("aabaabaa", "b")  = 2
     * StringUtils.indexOfIgnoreCase("aabaabaa", "ab") = 1
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @return the first index of the search CharSequence, -1 if no match or {@code null} string input
     * @since 2.5
     * @since 3.0 Changed signature from indexOfIgnoreCase(String, String) to
     *        indexOfIgnoreCase(CharSequence, CharSequence)
     */
    public int indexOfIgnoreCase(final CharSequence searchStr) {
        return StringUtils.indexOfIgnoreCase(str, searchStr);
    }

    /**
     * Case in-sensitive find of the first index within a CharSequence from the specified position.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position is treated as zero.
     * An empty ("") search CharSequence always matches. A start position greater than the string length
     * only matches an empty search CharSequence.
     * </p>
     *
     * <pre>
     * StringUtils.indexOfIgnoreCase(null, *, *)          = -1
     * StringUtils.indexOfIgnoreCase(*, null, *)          = -1
     * StringUtils.indexOfIgnoreCase("", "", 0)           = 0
     * StringUtils.indexOfIgnoreCase("aabaabaa", "A", 0)  = 0
     * StringUtils.indexOfIgnoreCase("aabaabaa", "B", 0)  = 2
     * StringUtils.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
     * StringUtils.indexOfIgnoreCase("aabaabaa", "B", 3)  = 5
     * StringUtils.indexOfIgnoreCase("aabaabaa", "B", 9)  = -1
     * StringUtils.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
     * StringUtils.indexOfIgnoreCase("aabaabaa", "", 2)   = 2
     * StringUtils.indexOfIgnoreCase("abc", "", 9)        = -1
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @param startPos the start position, negative treated as zero
     * @return the first index of the search CharSequence (always &ge; startPos), -1 if no match or
     *         {@code null} string input
     * @since 2.5
     * @since 3.0 Changed signature from indexOfIgnoreCase(String, String, int) to
     *        indexOfIgnoreCase(CharSequence, CharSequence, int)
     */
    public int indexOfIgnoreCase(final CharSequence searchStr, int startPos) {
        return StringUtils.indexOfIgnoreCase(str, searchStr, startPos);
    }

    /**
     * Checks if the CharSequence contains only lowercase characters.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.isAllLowerCase(null)   = false
     * StringUtils.isAllLowerCase("")     = false
     * StringUtils.isAllLowerCase("  ")   = false
     * StringUtils.isAllLowerCase("abc")  = true
     * StringUtils.isAllLowerCase("abC")  = false
     * StringUtils.isAllLowerCase("ab c") = false
     * StringUtils.isAllLowerCase("ab1c") = false
     * StringUtils.isAllLowerCase("ab/c") = false
     * </pre>
     *
     * @return {@code true} if only contains lowercase characters, and is non-null
     * @since 2.5
     * @since 3.0 Changed signature from isAllLowerCase(String) to isAllLowerCase(CharSequence)
     */
    public boolean isAllLowerCase() {
        return StringUtils.isAllLowerCase(str);
    }

    /**
     * Checks if the CharSequence contains only uppercase characters.
     * <p>
     * {@code null} will return {@code false}. An empty String (length()=0) will return {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.isAllUpperCase(null)   = false
     * StringUtils.isAllUpperCase("")     = false
     * StringUtils.isAllUpperCase("  ")   = false
     * StringUtils.isAllUpperCase("ABC")  = true
     * StringUtils.isAllUpperCase("aBC")  = false
     * StringUtils.isAllUpperCase("A C")  = false
     * StringUtils.isAllUpperCase("A1C")  = false
     * StringUtils.isAllUpperCase("A/C")  = false
     * </pre>
     *
     * @return {@code true} if only contains uppercase characters, and is non-null
     * @since 2.5
     * @since 3.0 Changed signature from isAllUpperCase(String) to isAllUpperCase(CharSequence)
     */
    public boolean isAllUpperCase() {
        return StringUtils.isAllUpperCase(str);
    }

    /**
     * Checks if the CharSequence contains only Unicode letters.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.isAlpha(null)   = false
     * StringUtils.isAlpha("")     = false
     * StringUtils.isAlpha("  ")   = false
     * StringUtils.isAlpha("abc")  = true
     * StringUtils.isAlpha("ab2c") = false
     * StringUtils.isAlpha("ab-c") = false
     * </pre>
     *
     * @return {@code true} if only contains letters, and is non-null
     * @since 3.0 Changed signature from isAlpha(String) to isAlpha(CharSequence)
     * @since 3.0 Changed "" to return false and not true
     */
    public boolean isAlpha() {
        return StringUtils.isAlpha(str);
    }

    /**
     * Checks if the CharSequence contains only Unicode letters or digits.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.isAlphanumeric(null)   = false
     * StringUtils.isAlphanumeric("")     = false
     * StringUtils.isAlphanumeric("  ")   = false
     * StringUtils.isAlphanumeric("abc")  = true
     * StringUtils.isAlphanumeric("ab c") = false
     * StringUtils.isAlphanumeric("ab2c") = true
     * StringUtils.isAlphanumeric("ab-c") = false
     * </pre>
     *
     * @return {@code true} if only contains letters or digits, and is non-null
     * @since 3.0 Changed signature from isAlphanumeric(String) to isAlphanumeric(CharSequence)
     * @since 3.0 Changed "" to return false and not true
     */
    public boolean isAlphanumeric() {
        return StringUtils.isAlphanumeric(str);
    }

    /**
     * Checks if the CharSequence contains only Unicode letters, digits or space ({@code ' '}).
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.isAlphanumericSpace(null)   = false
     * StringUtils.isAlphanumericSpace("")     = true
     * StringUtils.isAlphanumericSpace("  ")   = true
     * StringUtils.isAlphanumericSpace("abc")  = true
     * StringUtils.isAlphanumericSpace("ab c") = true
     * StringUtils.isAlphanumericSpace("ab2c") = true
     * StringUtils.isAlphanumericSpace("ab-c") = false
     * </pre>
     *
     * @return {@code true} if only contains letters, digits or space, and is non-null
     * @since 3.0 Changed signature from isAlphanumericSpace(String) to
     *        isAlphanumericSpace(CharSequence)
     */
    public boolean isAlphanumericSpace() {
        return StringUtils.isAlphanumericSpace(str);
    }

    /**
     * Checks if the CharSequence contains only Unicode letters and space (' ').
     * <p>
     * {@code null} will return {@code false} An empty CharSequence (length()=0) will return
     * {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.isAlphaSpace(null)   = false
     * StringUtils.isAlphaSpace("")     = true
     * StringUtils.isAlphaSpace("  ")   = true
     * StringUtils.isAlphaSpace("abc")  = true
     * StringUtils.isAlphaSpace("ab c") = true
     * StringUtils.isAlphaSpace("ab2c") = false
     * StringUtils.isAlphaSpace("ab-c") = false
     * </pre>
     *
     * @return {@code true} if only contains letters and space, and is non-null
     * @since 3.0 Changed signature from isAlphaSpace(String) to isAlphaSpace(CharSequence)
     */
    public boolean isAlphaSpace() {
        return StringUtils.isAlphaSpace(str);
    }

    /**
     * Checks if the CharSequence contains only ASCII printable characters.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.isAsciiPrintable(null)     = false
     * StringUtils.isAsciiPrintable("")       = true
     * StringUtils.isAsciiPrintable(" ")      = true
     * StringUtils.isAsciiPrintable("Ceki")   = true
     * StringUtils.isAsciiPrintable("ab2c")   = true
     * StringUtils.isAsciiPrintable("!ab-c~") = true
     * StringUtils.isAsciiPrintable("\u0020") = true
     * StringUtils.isAsciiPrintable("\u0021") = true
     * StringUtils.isAsciiPrintable("\u007e") = true
     * StringUtils.isAsciiPrintable("\u007f") = false
     * StringUtils.isAsciiPrintable("Ceki G\u00fclc\u00fc") = false
     * </pre>
     *
     * @return {@code true} if every character is in the range 32 through 126
     * @since 2.1
     * @since 3.0 Changed signature from isAsciiPrintable(String) to isAsciiPrintable(CharSequence)
     */
    public boolean isAsciiPrintable() {
        return StringUtils.isAsciiPrintable(str);
    }

    /**
     * Checks if a CharSequence is empty (""), null or whitespace only.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.isBlank(null)      = true
     * StringUtils.isBlank("")        = true
     * StringUtils.isBlank(" ")       = true
     * StringUtils.isBlank("bob")     = false
     * StringUtils.isBlank("  bob  ") = false
     * </pre>
     *
     * @return {@code true} if the CharSequence is null, empty or whitespace only
     * @since 2.0
     * @since 3.0 Changed signature from isBlank(String) to isBlank(CharSequence)
     */
    public boolean isBlank() {
        return StringUtils.isBlank(str);
    }

    /**
     * Checks if a CharSequence is empty ("") or null.
     *
     * <pre>
     * StringUtils.isEmpty(null)      = true
     * StringUtils.isEmpty("")        = true
     * StringUtils.isEmpty(" ")       = false
     * StringUtils.isEmpty("bob")     = false
     * StringUtils.isEmpty("  bob  ") = false
     * </pre>
     * <p>
     * NOTE: This method changed in Lang version 2.0. It no longer trims the CharSequence. That
     * functionality is available in isBlank().
     * </p>
     *
     * @return {@code true} if the CharSequence is empty or null
     * @since 3.0 Changed signature from isEmpty(String) to isEmpty(CharSequence)
     */
    public boolean isEmpty() {
        return StringUtils.isEmpty(str);
    }

    @Override
    public CharSequence subSequence(int start, int end) {
        return null;
    }

    /**
     * Checks if the CharSequence contains mixed casing of both uppercase and lowercase characters.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence ({@code length()=0}) will return
     * {@code false}.
     * </p>
     *
     * <pre>
     * StringUtils.isMixedCase(null)    = false
     * StringUtils.isMixedCase("")      = false
     * StringUtils.isMixedCase(" ")     = false
     * StringUtils.isMixedCase("ABC")   = false
     * StringUtils.isMixedCase("abc")   = false
     * StringUtils.isMixedCase("aBc")   = true
     * StringUtils.isMixedCase("A c")   = true
     * StringUtils.isMixedCase("A1c")   = true
     * StringUtils.isMixedCase("a/C")   = true
     * StringUtils.isMixedCase("aC\t")  = true
     * </pre>
     *
     * @return {@code true} if the CharSequence contains both uppercase and lowercase characters
     * @since 3.5
     */
    public boolean isMixedCase() {
        return StringUtils.isMixedCase(str);
    }

    /**
     * Checks if a CharSequence is not empty (""), not null and not whitespace only.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.isNotBlank(null)      = false
     * StringUtils.isNotBlank("")        = false
     * StringUtils.isNotBlank(" ")       = false
     * StringUtils.isNotBlank("bob")     = true
     * StringUtils.isNotBlank("  bob  ") = true
     * </pre>
     *
     * @return {@code true} if the CharSequence is not empty and not null and not whitespace only
     * @since 2.0
     * @since 3.0 Changed signature from isNotBlank(String) to isNotBlank(CharSequence)
     */
    public boolean isNotBlank() {
        return !isBlank();
    }

    /**
     * Checks if a CharSequence is not empty ("") and not null.
     *
     * <pre>
     * StringUtils.isNotEmpty(null)      = false
     * StringUtils.isNotEmpty("")        = false
     * StringUtils.isNotEmpty(" ")       = true
     * StringUtils.isNotEmpty("bob")     = true
     * StringUtils.isNotEmpty("  bob  ") = true
     * </pre>
     *
     * @return {@code true} if the CharSequence is not empty and not null
     * @since 3.0 Changed signature from isNotEmpty(String) to isNotEmpty(CharSequence)
     */
    public boolean isNotEmpty() {
        return !isEmpty();
    }

    /**
     * Checks if the CharSequence contains only Unicode digits. A decimal point is not a Unicode digit
     * and returns false.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code false}.
     * </p>
     * <p>
     * Note that the method does not allow for a leading sign, either positive or negative. Also, if a
     * String passes the numeric test, it may still generate a NumberFormatException when parsed by
     * Integer.parseInt or Long.parseLong, e.g. if the value is outside the range for int or long
     * respectively.
     * </p>
     *
     * <pre>
     * StringUtils.isNumeric(null)   = false
     * StringUtils.isNumeric("")     = false
     * StringUtils.isNumeric("  ")   = false
     * StringUtils.isNumeric("123")  = true
     * StringUtils.isNumeric("\u0967\u0968\u0969")  = true
     * StringUtils.isNumeric("12 3") = false
     * StringUtils.isNumeric("ab2c") = false
     * StringUtils.isNumeric("12-3") = false
     * StringUtils.isNumeric("12.3") = false
     * StringUtils.isNumeric("-123") = false
     * StringUtils.isNumeric("+123") = false
     * </pre>
     *
     * @return {@code true} if only contains digits, and is non-null
     * @since 3.0 Changed signature from isNumeric(String) to isNumeric(CharSequence)
     * @since 3.0 Changed "" to return false and not true
     */
    public boolean isNumeric() {
        return StringUtils.isNumeric(str);
    }

    /**
     * Checks if the CharSequence contains only Unicode digits or space ({@code ' '}). A decimal point
     * is not a Unicode digit and returns false.
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.isNumericSpace(null)   = false
     * StringUtils.isNumericSpace("")     = true
     * StringUtils.isNumericSpace("  ")   = true
     * StringUtils.isNumericSpace("123")  = true
     * StringUtils.isNumericSpace("12 3") = true
     * StringUtils.isNumericSpace("\u0967\u0968\u0969")  = true
     * StringUtils.isNumericSpace("\u0967\u0968 \u0969")  = true
     * StringUtils.isNumericSpace("ab2c") = false
     * StringUtils.isNumericSpace("12-3") = false
     * StringUtils.isNumericSpace("12.3") = false
     * </pre>
     *
     * @return {@code true} if only contains digits or space, and is non-null
     * @since 3.0 Changed signature from isNumericSpace(String) to isNumericSpace(CharSequence)
     */
    public boolean isNumericSpace() {
        return StringUtils.isNumericSpace(str);
    }

    /**
     * Checks if the CharSequence contains only whitespace.
     * <p>
     * Whitespace is defined by {@link Character#isWhitespace(char)}.
     * </p>
     * <p>
     * {@code null} will return {@code false}. An empty CharSequence (length()=0) will return
     * {@code true}.
     * </p>
     *
     * <pre>
     * StringUtils.isWhitespace(null)   = false
     * StringUtils.isWhitespace("")     = true
     * StringUtils.isWhitespace("  ")   = true
     * StringUtils.isWhitespace("abc")  = false
     * StringUtils.isWhitespace("ab2c") = false
     * StringUtils.isWhitespace("ab-c") = false
     * </pre>
     *
     * @return {@code true} if only contains whitespace, and is non-null
     * @since 2.0
     * @since 3.0 Changed signature from isWhitespace(String) to isWhitespace(CharSequence)
     */
    public boolean isWhitespace() {
        return StringUtils.isWhitespace(str);
    }

    /**
     * Finds the last index within a CharSequence, handling {@code null}. This method uses
     * {@link String#lastIndexOf(String)} if possible.
     * <p>
     * A {@code null} CharSequence will return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.lastIndexOf(null, *)          = -1
     * StringUtils.lastIndexOf(*, null)          = -1
     * StringUtils.lastIndexOf("", "")           = 0
     * StringUtils.lastIndexOf("aabaabaa", "a")  = 7
     * StringUtils.lastIndexOf("aabaabaa", "b")  = 5
     * StringUtils.lastIndexOf("aabaabaa", "ab") = 4
     * StringUtils.lastIndexOf("aabaabaa", "")   = 8
     * </pre>
     *
     * @param searchSeq the CharSequence to find, may be null
     * @return the last index of the search String, -1 if no match or {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from lastIndexOf(String, String) to lastIndexOf(CharSequence,
     *        CharSequence)
     */
    public int lastIndexOf(final CharSequence searchSeq) {
        return StringUtils.lastIndexOf(str, searchSeq);
    }

    /**
     * Finds the last index within a CharSequence, handling {@code null}. This method uses
     * {@link String#lastIndexOf(String, int)} if possible.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position returns {@code -1}.
     * An empty ("") search CharSequence always matches unless the start position is negative. A start
     * position greater than the string length searches the whole string. The search starts at the
     * startPos and works backwards; matches starting after the start position are ignored.
     * </p>
     *
     * <pre>
     * StringUtils.lastIndexOf(null, *, *)          = -1
     * StringUtils.lastIndexOf(*, null, *)          = -1
     * StringUtils.lastIndexOf("aabaabaa", "a", 8)  = 7
     * StringUtils.lastIndexOf("aabaabaa", "b", 8)  = 5
     * StringUtils.lastIndexOf("aabaabaa", "ab", 8) = 4
     * StringUtils.lastIndexOf("aabaabaa", "b", 9)  = 5
     * StringUtils.lastIndexOf("aabaabaa", "b", -1) = -1
     * StringUtils.lastIndexOf("aabaabaa", "a", 0)  = 0
     * StringUtils.lastIndexOf("aabaabaa", "b", 0)  = -1
     * StringUtils.lastIndexOf("aabaabaa", "b", 1)  = -1
     * StringUtils.lastIndexOf("aabaabaa", "b", 2)  = 2
     * StringUtils.lastIndexOf("aabaabaa", "ba", 2)  = 2
     * </pre>
     *
     * @param searchSeq the CharSequence to find, may be null
     * @param startPos the start position, negative treated as zero
     * @return the last index of the search CharSequence (always &le; startPos), -1 if no match or
     *         {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from lastIndexOf(String, String, int) to lastIndexOf(CharSequence,
     *        CharSequence, int)
     */
    public int lastIndexOf(final CharSequence searchSeq, final int startPos) {
        return StringUtils.lastIndexOf(str, searchSeq, startPos);
    }

    /**
     * Returns the index within {@code seq} of the last occurrence of the specified character. For
     * values of {@code searchChar} in the range from 0 to 0xFFFF (inclusive), the index (in Unicode
     * code units) returned is the largest value <i>k</i> such that: <blockquote>
     * 
     * <pre>
     * this.charAt(<i>k</i>) == searchChar
     * </pre>
     * 
     * </blockquote> is true. For other values of {@code searchChar}, it is the largest value <i>k</i>
     * such that: <blockquote>
     * 
     * <pre>
     * this.codePointAt(<i>k</i>) == searchChar
     * </pre>
     * 
     * </blockquote> is true. In either case, if no such character occurs in this string, then
     * {@code -1} is returned. Furthermore, a {@code null} or empty ("") {@link CharSequence} will
     * return {@code -1}. The {@code seq} {@link CharSequence} object is searched backwards starting at
     * the last character.
     *
     * <pre>
     * StringUtils.lastIndexOf(null, *)         = -1
     * StringUtils.lastIndexOf("", *)           = -1
     * StringUtils.lastIndexOf("aabaabaa", 'a') = 7
     * StringUtils.lastIndexOf("aabaabaa", 'b') = 5
     * </pre>
     *
     * @param searchChar the character to find
     * @return the last index of the search character, -1 if no match or {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from lastIndexOf(String, int) to lastIndexOf(CharSequence, int)
     * @since 3.6 Updated {@link CharSequenceUtils} call to behave more like {@link String}
     */
    public int lastIndexOf(final int searchChar) {
        return StringUtils.lastIndexOf(str, searchChar);
    }

    /**
     * Returns the index within {@code seq} of the last occurrence of the specified character, searching
     * backward starting at the specified index. For values of {@code searchChar} in the range from 0 to
     * 0xFFFF (inclusive), the index returned is the largest value <i>k</i> such that: <blockquote>
     * 
     * <pre>
     * (this.charAt(<i>k</i>) == searchChar) &amp;&amp; (<i>k</i> &lt;= startPos)
     * </pre>
     * 
     * </blockquote> is true. For other values of {@code searchChar}, it is the largest value <i>k</i>
     * such that: <blockquote>
     * 
     * <pre>
     * (this.codePointAt(<i>k</i>) == searchChar) &amp;&amp; (<i>k</i> &lt;= startPos)
     * </pre>
     * 
     * </blockquote> is true. In either case, if no such character occurs in {@code seq} at or before
     * position {@code startPos}, then {@code -1} is returned. Furthermore, a {@code null} or empty ("")
     * {@link CharSequence} will return {@code -1}. A start position greater than the string length
     * searches the whole string. The search starts at the {@code startPos} and works backwards; matches
     * starting after the start position are ignored.
     * <p>
     * All indices are specified in {@code char} values (Unicode code units).
     *
     * <pre>
     * StringUtils.lastIndexOf(null, *, *)          = -1
     * StringUtils.lastIndexOf("", *,  *)           = -1
     * StringUtils.lastIndexOf("aabaabaa", 'b', 8)  = 5
     * StringUtils.lastIndexOf("aabaabaa", 'b', 4)  = 2
     * StringUtils.lastIndexOf("aabaabaa", 'b', 0)  = -1
     * StringUtils.lastIndexOf("aabaabaa", 'b', 9)  = 5
     * StringUtils.lastIndexOf("aabaabaa", 'b', -1) = -1
     * StringUtils.lastIndexOf("aabaabaa", 'a', 0)  = 0
     * </pre>
     *
     * @param searchChar the character to find
     * @param startPos the start position
     * @return the last index of the search character (always &le; startPos), -1 if no match or
     *         {@code null} string input
     * @since 2.0
     * @since 3.0 Changed signature from lastIndexOf(String, int, int) to lastIndexOf(CharSequence, int,
     *        int)
     */
    public int lastIndexOf(final int searchChar, final int startPos) {
        return StringUtils.lastIndexOf(str, searchChar, startPos);
    }

    /**
     * Find the latest index of any substring in a set of potential substrings.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A {@code null} search array will return
     * {@code -1}. A {@code null} or zero length search array entry will be ignored, but a search array
     * containing "" will return the length of {@code str} if {@code str} is not null. This method uses
     * {@link String#indexOf(String)} if possible
     * </p>
     *
     * <pre>
     * StringUtils.lastIndexOfAny(null, *)                    = -1
     * StringUtils.lastIndexOfAny(*, null)                    = -1
     * StringUtils.lastIndexOfAny(*, [])                      = -1
     * StringUtils.lastIndexOfAny(*, [null])                  = -1
     * StringUtils.lastIndexOfAny("zzabyycdxx", ["ab", "cd"]) = 6
     * StringUtils.lastIndexOfAny("zzabyycdxx", ["cd", "ab"]) = 6
     * StringUtils.lastIndexOfAny("zzabyycdxx", ["mn", "op"]) = -1
     * StringUtils.lastIndexOfAny("zzabyycdxx", ["mn", "op"]) = -1
     * StringUtils.lastIndexOfAny("zzabyycdxx", ["mn", ""])   = 10
     * </pre>
     *
     * @param searchStrs the CharSequences to search for, may be null
     * @return the last index of any of the CharSequences, -1 if no match
     * @since 3.0 Changed signature from lastIndexOfAny(String, String[]) to
     *        lastIndexOfAny(CharSequence, CharSequence)
     */
    public int lastIndexOfAny(final CharSequence... searchStrs) {
        return StringUtils.lastIndexOfAny(str, searchStrs);
    }

    /**
     * Case in-sensitive find of the last index within a CharSequence.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position returns {@code -1}.
     * An empty ("") search CharSequence always matches unless the start position is negative. A start
     * position greater than the string length searches the whole string.
     * </p>
     *
     * <pre>
     * StringUtils.lastIndexOfIgnoreCase(null, *)          = -1
     * StringUtils.lastIndexOfIgnoreCase(*, null)          = -1
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "A")  = 7
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B")  = 5
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "AB") = 4
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @return the first index of the search CharSequence, -1 if no match or {@code null} string input
     * @since 2.5
     * @since 3.0 Changed signature from lastIndexOfIgnoreCase(String, String) to
     *        lastIndexOfIgnoreCase(CharSequence, CharSequence)
     */
    public int lastIndexOfIgnoreCase(final CharSequence searchStr) {
        return StringUtils.lastIndexOfIgnoreCase(str, searchStr);
    }

    /**
     * Case in-sensitive find of the last index within a CharSequence from the specified position.
     * <p>
     * A {@code null} CharSequence will return {@code -1}. A negative start position returns {@code -1}.
     * An empty ("") search CharSequence always matches unless the start position is negative. A start
     * position greater than the string length searches the whole string. The search starts at the
     * startPos and works backwards; matches starting after the start position are ignored.
     * </p>
     *
     * <pre>
     * StringUtils.lastIndexOfIgnoreCase(null, *, *)          = -1
     * StringUtils.lastIndexOfIgnoreCase(*, null, *)          = -1
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "A", 8)  = 7
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 8)  = 5
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "AB", 8) = 4
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 9)  = 5
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", -1) = -1
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "A", 0)  = 0
     * StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 0)  = -1
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @param startPos the start position
     * @return the last index of the search CharSequence (always &le; startPos), -1 if no match or
     *         {@code null} input
     * @since 2.5
     * @since 3.0 Changed signature from lastIndexOfIgnoreCase(String, String, int) to
     *        lastIndexOfIgnoreCase(CharSequence, CharSequence, int)
     */
    public int lastIndexOfIgnoreCase(final CharSequence searchStr, int startPos) {
        return StringUtils.lastIndexOfIgnoreCase(str, searchStr, startPos);
    }

    /**
     * Finds the n-th last index within a String, handling {@code null}. This method uses
     * {@link String#lastIndexOf(String)}.
     * <p>
     * A {@code null} String will return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.lastOrdinalIndexOf(null, *, *)          = -1
     * StringUtils.lastOrdinalIndexOf(*, null, *)          = -1
     * StringUtils.lastOrdinalIndexOf("", "", *)           = 0
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "a", 1)  = 7
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "a", 2)  = 6
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "b", 1)  = 5
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "b", 2)  = 2
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "ab", 1) = 4
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "ab", 2) = 1
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "", 1)   = 8
     * StringUtils.lastOrdinalIndexOf("aabaabaa", "", 2)   = 8
     * </pre>
     * <p>
     * Note that 'tail(CharSequence str, int n)' may be implemented as:
     * </p>
     *
     * <pre>
     * str.substring(lastOrdinalIndexOf(str, "\n", n) + 1)
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @param ordinal the n-th last {@code searchStr} to find
     * @return the n-th last index of the search CharSequence, {@code -1} ({@code INDEX_NOT_FOUND}) if
     *         no match or {@code null} string input
     * @since 2.5
     * @since 3.0 Changed signature from lastOrdinalIndexOf(String, String, int) to
     *        lastOrdinalIndexOf(CharSequence, CharSequence, int)
     */
    public int lastOrdinalIndexOf(final CharSequence searchStr, final int ordinal) {
        return StringUtils.lastOrdinalIndexOf(str, searchStr, ordinal);
    }

    /**
     * Gets the leftmost {@code len} characters of a String.
     * <p>
     * If {@code len} characters are not available, or the String is {@code null}, the String will be
     * returned without an exception. An empty String is returned if len is negative.
     * </p>
     *
     * <pre>
     * StringUtils.left(null, *)    = null
     * StringUtils.left(*, -ve)     = ""
     * StringUtils.left("", *)      = ""
     * StringUtils.left("abc", 0)   = ""
     * StringUtils.left("abc", 2)   = "ab"
     * StringUtils.left("abc", 4)   = "abc"
     * </pre>
     *
     * @param len the length of the required String
     * @return the leftmost characters, {@code null} if null String input
     */
    public StrEx left(final int len) {
        return with(StringUtils.left(str, len));
    }

    /**
     * Left pad a String with spaces (' ').
     * <p>
     * The String is padded to the size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.leftPad(null, *)   = null
     * StringUtils.leftPad("", 3)     = "   "
     * StringUtils.leftPad("bat", 3)  = "bat"
     * StringUtils.leftPad("bat", 5)  = "  bat"
     * StringUtils.leftPad("bat", 1)  = "bat"
     * StringUtils.leftPad("bat", -1) = "bat"
     * </pre>
     *
     * @param size the size to pad to
     * @return left padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     */
    public StrEx leftPad(final int size) {
        return with(StringUtils.leftPad(str, size));
    }

    /**
     * Left pad a String with a specified character.
     * <p>
     * Pad to a size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.leftPad(null, *, *)     = null
     * StringUtils.leftPad("", 3, 'z')     = "zzz"
     * StringUtils.leftPad("bat", 3, 'z')  = "bat"
     * StringUtils.leftPad("bat", 5, 'z')  = "zzbat"
     * StringUtils.leftPad("bat", 1, 'z')  = "bat"
     * StringUtils.leftPad("bat", -1, 'z') = "bat"
     * </pre>
     *
     * @param size the size to pad to
     * @param padChar the character to pad with
     * @return left padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     * @since 2.0
     */
    public StrEx leftPad(final int size, final char padChar) {
        return with(StringUtils.leftPad(str, size, padChar));
    }

    /**
     * Left pad a String with a specified String.
     * <p>
     * Pad to a size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.leftPad(null, *, *)      = null
     * StringUtils.leftPad("", 3, "z")      = "zzz"
     * StringUtils.leftPad("bat", 3, "yz")  = "bat"
     * StringUtils.leftPad("bat", 5, "yz")  = "yzbat"
     * StringUtils.leftPad("bat", 8, "yz")  = "yzyzybat"
     * StringUtils.leftPad("bat", 1, "yz")  = "bat"
     * StringUtils.leftPad("bat", -1, "yz") = "bat"
     * StringUtils.leftPad("bat", 5, null)  = "  bat"
     * StringUtils.leftPad("bat", 5, "")    = "  bat"
     * </pre>
     *
     * @param size the size to pad to
     * @param padStr the String to pad with, null or empty treated as single space
     * @return left padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     */
    public StrEx leftPad(final int size, String padStr) {
        return with(StringUtils.leftPad(str, size, padStr));
    }

    /**
     * Gets a CharSequence length or {@code 0} if the CharSequence is {@code null}.
     *
     * @return CharSequence length or {@code 0} if the CharSequence is {@code null}.
     * @since 2.4
     * @since 3.0 Changed signature from length(String) to length(CharSequence)
     */
    public int length() {
        return str == null ? 0 : str.length();
    }

    /**
     * Converts a String to lower case as per {@link String#toLowerCase()}.
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.lowerCase(null)  = null
     * StringUtils.lowerCase("")    = ""
     * StringUtils.lowerCase("aBc") = "abc"
     * </pre>
     * <p>
     * <strong>Note:</strong> As described in the documentation for {@link String#toLowerCase()}, the
     * result of this method is affected by the current locale. For platform-independent case
     * transformations, the method {#lowerCase(String, Locale)} should be used with a specific locale
     * (e.g. {@link Locale#ENGLISH}).
     * </p>
     *
     * @return the lower cased String, {@code null} if null String input
     */
    public StrEx lowerCase() {
        return with(str == null ? null : str.toLowerCase());
    }

    /**
     * Converts a String to lower case as per {@link String#toLowerCase(Locale)}.
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.lowerCase(null, Locale.ENGLISH)  = null
     * StringUtils.lowerCase("", Locale.ENGLISH)    = ""
     * StringUtils.lowerCase("aBc", Locale.ENGLISH) = "abc"
     * </pre>
     *
     * @param locale the locale that defines the case transformation rules, must not be null
     * @return the lower cased String, {@code null} if null String input
     * @since 2.5
     */
    public StrEx lowerCase(final Locale locale) {
        return with(str == null ? null : str.toLowerCase(LocaleUtils.toLocale(locale)));
    }

    private static int[] matches(final CharSequence first, final CharSequence second) {
        final CharSequence max;
        final CharSequence min;
        if (first.length() > second.length()) {
            max = first;
            min = second;
        } else {
            max = second;
            min = first;
        }
        final int range = Math.max(max.length() / 2 - 1, 0);
        final int[] matchIndexes = new int[min.length()];
        Arrays.fill(matchIndexes, -1);
        final boolean[] matchFlags = new boolean[max.length()];
        int matches = 0;
        for (int mi = 0; mi < min.length(); mi++) {
            final char c1 = min.charAt(mi);
            for (int xi = Math.max(mi - range, 0), xn = Math.min(mi + range + 1, max.length()); xi < xn; xi++) {
                if (!matchFlags[xi] && c1 == max.charAt(xi)) {
                    matchIndexes[mi] = xi;
                    matchFlags[xi] = true;
                    matches++;
                    break;
                }
            }
        }
        final char[] ms1 = new char[matches];
        final char[] ms2 = new char[matches];
        for (int i = 0, si = 0; i < min.length(); i++) {
            if (matchIndexes[i] != -1) {
                ms1[si] = min.charAt(i);
                si++;
            }
        }
        for (int i = 0, si = 0; i < max.length(); i++) {
            if (matchFlags[i]) {
                ms2[si] = max.charAt(i);
                si++;
            }
        }
        int transpositions = 0;
        for (int mi = 0; mi < ms1.length; mi++) {
            if (ms1[mi] != ms2[mi]) {
                transpositions++;
            }
        }
        int prefix = 0;
        for (int mi = 0; mi < min.length(); mi++) {
            if (first.charAt(mi) != second.charAt(mi)) {
                break;
            }
            prefix++;
        }
        return new int[] {matches, transpositions / 2, prefix, max.length()};
    }

    /**
     * Gets {@code len} characters from the middle of a String.
     * <p>
     * If {@code len} characters are not available, the remainder of the String will be returned without
     * an exception. If the String is {@code null}, {@code null} will be returned. An empty String is
     * returned if len is negative or exceeds the length of {@code str}.
     * </p>
     *
     * <pre>
     * StringUtils.mid(null, *, *)    = null
     * StringUtils.mid(*, *, -ve)     = ""
     * StringUtils.mid("", 0, *)      = ""
     * StringUtils.mid("abc", 0, 2)   = "ab"
     * StringUtils.mid("abc", 0, 4)   = "abc"
     * StringUtils.mid("abc", 2, 4)   = "c"
     * StringUtils.mid("abc", 4, 2)   = ""
     * StringUtils.mid("abc", -2, 2)  = "ab"
     * </pre>
     *
     * @param pos the position to start from, negative treated as zero
     * @param len the length of the required String
     * @return the middle characters, {@code null} if null String input
     */
    public StrEx mid(int pos, final int len) {
        return with(StringUtils.mid(str, pos, len));
    }

    /**
     * Similar to <a href=
     * "https://www.w3.org/TR/xpath/#function-normalize-space">https://www.w3.org/TR/xpath/#function-normalize
     * -space</a>
     * <p>
     * The function returns the argument string with whitespace normalized by using
     * {@code {#trim(String)}} to remove leading and trailing whitespace and then replacing sequences of
     * whitespace characters by a single space.
     * </p>
     * In XML Whitespace characters are the same as those allowed by the
     * <a href="https://www.w3.org/TR/REC-xml/#NT-S">S</a> production, which is S ::= (#x20 | #x9 | #xD
     * | #xA)+
     * <p>
     * Java's regexp pattern \s defines whitespace as [ \t\n\x0B\f\r]
     * <p>
     * For reference:
     * </p>
     * <ul>
     * <li>\x0B = vertical tab</li>
     * <li>\f = #xC = form feed</li>
     * <li>#x20 = space</li>
     * <li>#x9 = \t</li>
     * <li>#xA = \n</li>
     * <li>#xD = \r</li>
     * </ul>
     * <p>
     * The difference is that Java's whitespace includes vertical tab and form feed, which this
     * functional will also normalize. Additionally {@code {#trim(String)}} removes control characters
     * (char &lt;= 32) from both ends of this String.
     * </p>
     *
     * @return the modified string with whitespace normalized, {@code null} if null String input
     * @see Pattern
     * @see <a href=
     *      "https://www.w3.org/TR/xpath/#function-normalize-space">https://www.w3.org/TR/xpath/#function-normalize-space</a>
     * @since 3.0
     */
    public StrEx normalizeSpace() {
        return with(StringUtils.normalizeSpace(str));
    }

    /**
     * Finds the n-th index within a CharSequence, handling {@code null}. This method uses
     * {@link String#indexOf(String)} if possible.
     * <p>
     * <b>Note:</b> The code starts looking for a match at the start of the target, incrementing the
     * starting index by one after each successful match (unless {@code searchStr} is an empty string in
     * which case the position is never incremented and {@code 0} is returned immediately). This means
     * that matches may overlap.
     * </p>
     * <p>
     * A {@code null} CharSequence will return {@code -1}.
     * </p>
     *
     * <pre>
     * StringUtils.ordinalIndexOf(null, *, *)          = -1
     * StringUtils.ordinalIndexOf(*, null, *)          = -1
     * StringUtils.ordinalIndexOf("", "", *)           = 0
     * StringUtils.ordinalIndexOf("aabaabaa", "a", 1)  = 0
     * StringUtils.ordinalIndexOf("aabaabaa", "a", 2)  = 1
     * StringUtils.ordinalIndexOf("aabaabaa", "b", 1)  = 2
     * StringUtils.ordinalIndexOf("aabaabaa", "b", 2)  = 5
     * StringUtils.ordinalIndexOf("aabaabaa", "ab", 1) = 1
     * StringUtils.ordinalIndexOf("aabaabaa", "ab", 2) = 4
     * StringUtils.ordinalIndexOf("aabaabaa", "", 1)   = 0
     * StringUtils.ordinalIndexOf("aabaabaa", "", 2)   = 0
     * </pre>
     * <p>
     * Matches may overlap:
     * </p>
     * 
     * <pre>
     * StringUtils.ordinalIndexOf("ababab", "aba", 1)   = 0
     * StringUtils.ordinalIndexOf("ababab", "aba", 2)   = 2
     * StringUtils.ordinalIndexOf("ababab", "aba", 3)   = -1
     *
     * StringUtils.ordinalIndexOf("abababab", "abab", 1) = 0
     * StringUtils.ordinalIndexOf("abababab", "abab", 2) = 2
     * StringUtils.ordinalIndexOf("abababab", "abab", 3) = 4
     * StringUtils.ordinalIndexOf("abababab", "abab", 4) = -1
     * </pre>
     * <p>
     * Note that 'head(CharSequence str, int n)' may be implemented as:
     * </p>
     *
     * <pre>
     * str.substring(0, lastOrdinalIndexOf(str, "\n", n))
     * </pre>
     *
     * @param searchStr the CharSequence to find, may be null
     * @param ordinal the n-th {@code searchStr} to find
     * @return the n-th index of the search CharSequence, {@code -1} ({@code INDEX_NOT_FOUND}) if no
     *         match or {@code null} string input
     * @since 2.1
     * @since 3.0 Changed signature from ordinalIndexOf(String, String, int) to
     *        ordinalIndexOf(CharSequence, CharSequence, int)
     */
    public int ordinalIndexOf(final CharSequence searchStr, final int ordinal) {
        return StringUtils.ordinalIndexOf(str, searchStr, ordinal);
    }

    /**
     * Overlays part of a String with another String.
     * <p>
     * A {@code null} string input returns {@code null}. A negative index is treated as zero. An index
     * greater than the string length is treated as the string length. The start index is always the
     * smaller of the two indices.
     * </p>
     *
     * <pre>
     * StringUtils.overlay(null, *, *, *)            = null
     * StringUtils.overlay("", "abc", 0, 0)          = "abc"
     * StringUtils.overlay("abcdef", null, 2, 4)     = "abef"
     * StringUtils.overlay("abcdef", "", 2, 4)       = "abef"
     * StringUtils.overlay("abcdef", "", 4, 2)       = "abef"
     * StringUtils.overlay("abcdef", "zzzz", 2, 4)   = "abzzzzef"
     * StringUtils.overlay("abcdef", "zzzz", 4, 2)   = "abzzzzef"
     * StringUtils.overlay("abcdef", "zzzz", -1, 4)  = "zzzzef"
     * StringUtils.overlay("abcdef", "zzzz", 2, 8)   = "abzzzz"
     * StringUtils.overlay("abcdef", "zzzz", -2, -3) = "zzzzabcdef"
     * StringUtils.overlay("abcdef", "zzzz", 8, 10)  = "abcdefzzzz"
     * </pre>
     *
     * @param overlay the String to overlay, may be null
     * @param start the position to start overlaying at
     * @param end the position to stop overlaying before
     * @return overlayed String, {@code null} if null String input
     * @since 2.0
     */
    public StrEx overlay(final String str, String overlay, int start, int end) {
        return with(StringUtils.overlay(str, overlay, start, end));
    }

    /**
     * Prepends the prefix to the start of the string if the string does not already start with any of
     * the prefixes.
     *
     * <pre>
     * StringUtils.prependIfMissing(null, null) = null
     * StringUtils.prependIfMissing("abc", null) = "abc"
     * StringUtils.prependIfMissing("", "xyz") = "xyz"
     * StringUtils.prependIfMissing("abc", "xyz") = "xyzabc"
     * StringUtils.prependIfMissing("xyzabc", "xyz") = "xyzabc"
     * StringUtils.prependIfMissing("XYZabc", "xyz") = "xyzXYZabc"
     * </pre>
     * <p>
     * With additional prefixes,
     * </p>
     * 
     * <pre>
     * StringUtils.prependIfMissing(null, null, null) = null
     * StringUtils.prependIfMissing("abc", null, null) = "abc"
     * StringUtils.prependIfMissing("", "xyz", null) = "xyz"
     * StringUtils.prependIfMissing("abc", "xyz", new CharSequence[]{null}) = "xyzabc"
     * StringUtils.prependIfMissing("abc", "xyz", "") = "abc"
     * StringUtils.prependIfMissing("abc", "xyz", "mno") = "xyzabc"
     * StringUtils.prependIfMissing("xyzabc", "xyz", "mno") = "xyzabc"
     * StringUtils.prependIfMissing("mnoabc", "xyz", "mno") = "mnoabc"
     * StringUtils.prependIfMissing("XYZabc", "xyz", "mno") = "xyzXYZabc"
     * StringUtils.prependIfMissing("MNOabc", "xyz", "mno") = "xyzMNOabc"
     * </pre>
     *
     * @param prefix The prefix to prepend to the start of the string.
     * @param prefixes Additional prefixes that are valid.
     * @return A new String if prefix was prepended, the same string otherwise.
     * @since 3.2
     */
    public StrEx prependIfMissing(final CharSequence prefix, final CharSequence... prefixes) {
        return with(StringUtils.prependIfMissing(str, prefix, prefixes));
    }

    /**
     * Prepends the prefix to the start of the string if the string does not already start,
     * case-insensitive, with any of the prefixes.
     *
     * <pre>
     * StringUtils.prependIfMissingIgnoreCase(null, null) = null
     * StringUtils.prependIfMissingIgnoreCase("abc", null) = "abc"
     * StringUtils.prependIfMissingIgnoreCase("", "xyz") = "xyz"
     * StringUtils.prependIfMissingIgnoreCase("abc", "xyz") = "xyzabc"
     * StringUtils.prependIfMissingIgnoreCase("xyzabc", "xyz") = "xyzabc"
     * StringUtils.prependIfMissingIgnoreCase("XYZabc", "xyz") = "XYZabc"
     * </pre>
     * <p>
     * With additional prefixes,
     * </p>
     * 
     * <pre>
     * StringUtils.prependIfMissingIgnoreCase(null, null, null) = null
     * StringUtils.prependIfMissingIgnoreCase("abc", null, null) = "abc"
     * StringUtils.prependIfMissingIgnoreCase("", "xyz", null) = "xyz"
     * StringUtils.prependIfMissingIgnoreCase("abc", "xyz", new CharSequence[]{null}) = "xyzabc"
     * StringUtils.prependIfMissingIgnoreCase("abc", "xyz", "") = "abc"
     * StringUtils.prependIfMissingIgnoreCase("abc", "xyz", "mno") = "xyzabc"
     * StringUtils.prependIfMissingIgnoreCase("xyzabc", "xyz", "mno") = "xyzabc"
     * StringUtils.prependIfMissingIgnoreCase("mnoabc", "xyz", "mno") = "mnoabc"
     * StringUtils.prependIfMissingIgnoreCase("XYZabc", "xyz", "mno") = "XYZabc"
     * StringUtils.prependIfMissingIgnoreCase("MNOabc", "xyz", "mno") = "MNOabc"
     * </pre>
     *
     * @param prefix The prefix to prepend to the start of the string.
     * @param prefixes Additional prefixes that are valid (optional).
     * @return A new String if prefix was prepended, the same string otherwise.
     * @since 3.2
     */
    public StrEx prependIfMissingIgnoreCase(final CharSequence prefix, final CharSequence... prefixes) {
        return with(StringUtils.prependIfMissingIgnoreCase(str, prefix, prefixes));
    }

    /**
     * Removes all occurrences of a character from within the source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string.
     * </p>
     *
     * <pre>
     * StringUtils.remove(null, *)       = null
     * StringUtils.remove("", *)         = ""
     * StringUtils.remove("queued", 'u') = "qeed"
     * StringUtils.remove("queued", 'z') = "queued"
     * </pre>
     *
     * @param remove the char to search for and remove, may be null
     * @return the substring with the char removed if found, {@code null} if null String input
     * @since 2.1
     */
    public StrEx remove(final char remove) {
        return with(StringUtils.remove(str, remove));
    }

    /**
     * Removes all occurrences of a substring from within the source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} remove string will return the source string. An empty ("")
     * remove string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.remove(null, *)        = null
     * StringUtils.remove("", *)          = ""
     * StringUtils.remove(*, null)        = *
     * StringUtils.remove(*, "")          = *
     * StringUtils.remove("queued", "ue") = "qd"
     * StringUtils.remove("queued", "zz") = "queued"
     * </pre>
     *
     * @param remove the String to search for and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 2.1
     */
    public StrEx remove(final String remove) {
        return with(StringUtils.remove(str, remove));
    }

    /**
     * Removes a substring only if it is at the end of a source string, otherwise returns the source
     * string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} search string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeEnd(null, *)      = null
     * StringUtils.removeEnd("", *)        = ""
     * StringUtils.removeEnd(*, null)      = *
     * StringUtils.removeEnd("www.domain.com", ".com.")  = "www.domain.com"
     * StringUtils.removeEnd("www.domain.com", ".com")   = "www.domain"
     * StringUtils.removeEnd("www.domain.com", "domain") = "www.domain.com"
     * StringUtils.removeEnd("abc", "")    = "abc"
     * </pre>
     *
     * @param remove the String to search for and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 2.1
     */
    public StrEx removeEnd(final String remove) {
        return with(StringUtils.removeEnd(str, remove));
    }

    /**
     * Case insensitive removal of a substring if it is at the end of a source string, otherwise returns
     * the source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} search string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeEndIgnoreCase(null, *)      = null
     * StringUtils.removeEndIgnoreCase("", *)        = ""
     * StringUtils.removeEndIgnoreCase(*, null)      = *
     * StringUtils.removeEndIgnoreCase("www.domain.com", ".com.")  = "www.domain.com"
     * StringUtils.removeEndIgnoreCase("www.domain.com", ".com")   = "www.domain"
     * StringUtils.removeEndIgnoreCase("www.domain.com", "domain") = "www.domain.com"
     * StringUtils.removeEndIgnoreCase("abc", "")    = "abc"
     * StringUtils.removeEndIgnoreCase("www.domain.com", ".COM") = "www.domain")
     * StringUtils.removeEndIgnoreCase("www.domain.COM", ".com") = "www.domain")
     * </pre>
     *
     * @param remove the String to search for (case-insensitive) and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 2.4
     */
    public StrEx removeEndIgnoreCase(final String remove) {
        return with(StringUtils.removeEndIgnoreCase(str, remove));
    }

    /**
     * Case insensitive removal of all occurrences of a substring from within the source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} remove string will return the source string. An empty ("")
     * remove string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeIgnoreCase(null, *)        = null
     * StringUtils.removeIgnoreCase("", *)          = ""
     * StringUtils.removeIgnoreCase(*, null)        = *
     * StringUtils.removeIgnoreCase(*, "")          = *
     * StringUtils.removeIgnoreCase("queued", "ue") = "qd"
     * StringUtils.removeIgnoreCase("queued", "zz") = "queued"
     * StringUtils.removeIgnoreCase("quEUed", "UE") = "qd"
     * StringUtils.removeIgnoreCase("queued", "zZ") = "queued"
     * </pre>
     *
     * @param remove the String to search for (case-insensitive) and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 3.5
     */
    public StrEx removeIgnoreCase(final String remove) {
        return replaceIgnoreCase(remove, EMPTY, -1);
    }

    /**
     * Removes a char only if it is at the beginning of a source string, otherwise returns the source
     * string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} search char will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeStart(null, *)      = null
     * StringUtils.removeStart("", *)        = ""
     * StringUtils.removeStart(*, null)      = *
     * StringUtils.removeStart("/path", '/') = "path"
     * StringUtils.removeStart("path", '/')  = "path"
     * StringUtils.removeStart("path", 0)    = "path"
     * </pre>
     *
     * @param remove the char to search for and remove.
     * @return the substring with the char removed if found, {@code null} if null String input.
     * @since 3.13.0
     */
    public StrEx removeStart(final char remove) {
        return with(StringUtils.removeStart(str, remove));
    }

    /**
     * Removes a substring only if it is at the beginning of a source string, otherwise returns the
     * source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} search string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeStart(null, *)      = null
     * StringUtils.removeStart("", *)        = ""
     * StringUtils.removeStart(*, null)      = *
     * StringUtils.removeStart("www.domain.com", "www.")   = "domain.com"
     * StringUtils.removeStart("domain.com", "www.")       = "domain.com"
     * StringUtils.removeStart("www.domain.com", "domain") = "www.domain.com"
     * StringUtils.removeStart("abc", "")    = "abc"
     * </pre>
     *
     * @param remove the String to search for and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 2.1
     */
    public StrEx removeStart(final String remove) {
        return with(StringUtils.removeStart(str, remove));
    }

    /**
     * Case insensitive removal of a substring if it is at the beginning of a source string, otherwise
     * returns the source string.
     * <p>
     * A {@code null} source string will return {@code null}. An empty ("") source string will return
     * the empty string. A {@code null} search string will return the source string.
     * </p>
     *
     * <pre>
     * StringUtils.removeStartIgnoreCase(null, *)      = null
     * StringUtils.removeStartIgnoreCase("", *)        = ""
     * StringUtils.removeStartIgnoreCase(*, null)      = *
     * StringUtils.removeStartIgnoreCase("www.domain.com", "www.")   = "domain.com"
     * StringUtils.removeStartIgnoreCase("www.domain.com", "WWW.")   = "domain.com"
     * StringUtils.removeStartIgnoreCase("domain.com", "www.")       = "domain.com"
     * StringUtils.removeStartIgnoreCase("www.domain.com", "domain") = "www.domain.com"
     * StringUtils.removeStartIgnoreCase("abc", "")    = "abc"
     * </pre>
     *
     * @param remove the String to search for (case-insensitive) and remove, may be null
     * @return the substring with the string removed if found, {@code null} if null String input
     * @since 2.4
     */
    public StrEx removeStartIgnoreCase(final String remove) {
        return with(StringUtils.removeStartIgnoreCase(str, remove));
    }

    /**
     * Repeat a String {@code repeat} times to form a new String.
     *
     * <pre>
     * StringUtils.repeat(null, 2) = null
     * StringUtils.repeat("", 0)   = ""
     * StringUtils.repeat("", 2)   = ""
     * StringUtils.repeat("a", 3)  = "aaa"
     * StringUtils.repeat("ab", 2) = "abab"
     * StringUtils.repeat("a", -2) = ""
     * </pre>
     *
     * @param repeat number of times to repeat str, negative treated as zero
     * @return a new String consisting of the original String repeated, {@code null} if null String
     *         input
     */
    public StrEx repeat(final int repeat) {
        return with(StringUtils.repeat(str, repeat));
    }

    /**
     * Repeat a String {@code repeat} times to form a new String, with a String separator injected each
     * time.
     *
     * <pre>
     * StringUtils.repeat(null, null, 2) = null
     * StringUtils.repeat(null, "x", 2)  = null
     * StringUtils.repeat("", null, 0)   = ""
     * StringUtils.repeat("", "", 2)     = ""
     * StringUtils.repeat("", "x", 3)    = "xx"
     * StringUtils.repeat("?", ", ", 3)  = "?, ?, ?"
     * </pre>
     *
     * @param separator the String to inject, may be null
     * @param repeat number of times to repeat str, negative treated as zero
     * @return a new String consisting of the original String repeated, {@code null} if null String
     *         input
     * @since 2.5
     */
    public StrEx repeat(final String separator, final int repeat) {
        return with(StringUtils.repeat(str, separator, repeat));
    }

    /**
     * Replaces all occurrences of a String within another String.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replace(null, *, *)        = null
     * StringUtils.replace("", *, *)          = ""
     * StringUtils.replace("any", null, *)    = "any"
     * StringUtils.replace("any", *, null)    = "any"
     * StringUtils.replace("any", "", *)      = "any"
     * StringUtils.replace("aba", "a", null)  = "aba"
     * StringUtils.replace("aba", "a", "")    = "b"
     * StringUtils.replace("aba", "a", "z")   = "zbz"
     * </pre>
     *
     * @param searchString the String to search for, may be null
     * @param replacement the String to replace it with, may be null
     * @return the text with any replacements processed, {@code null} if null String input
     */
    public StrEx replace(final String searchString, final String replacement) {
        return with(StringUtils.replace(str, searchString, replacement));
    }

    /**
     * Replaces a String with another String inside a larger String, for the first {@code max} values of
     * the search String.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replace(null, *, *, *)         = null
     * StringUtils.replace("", *, *, *)           = ""
     * StringUtils.replace("any", null, *, *)     = "any"
     * StringUtils.replace("any", *, null, *)     = "any"
     * StringUtils.replace("any", "", *, *)       = "any"
     * StringUtils.replace("any", *, *, 0)        = "any"
     * StringUtils.replace("abaa", "a", null, -1) = "abaa"
     * StringUtils.replace("abaa", "a", "", -1)   = "b"
     * StringUtils.replace("abaa", "a", "z", 0)   = "abaa"
     * StringUtils.replace("abaa", "a", "z", 1)   = "zbaa"
     * StringUtils.replace("abaa", "a", "z", 2)   = "zbza"
     * StringUtils.replace("abaa", "a", "z", -1)  = "zbzz"
     * </pre>
     *
     * @param searchString the String to search for, may be null
     * @param replacement the String to replace it with, may be null
     * @param max maximum number of values to replace, or {@code -1} if no maximum
     * @return the text with any replacements processed, {@code null} if null String input
     */
    public StrEx replace(final String searchString, final String replacement, final int max) {
        return with(StringUtils.replace(str, searchString, replacement, max));
    }

    /**
     * Replaces all occurrences of a character in a String with another. This is a null-safe version of
     * {@link String#replace(char, char)}.
     * <p>
     * A {@code null} string input returns {@code null}. An empty ("") string input returns an empty
     * string.
     * </p>
     *
     * <pre>
     * StringUtils.replaceChars(null, *, *)        = null
     * StringUtils.replaceChars("", *, *)          = ""
     * StringUtils.replaceChars("abcba", 'b', 'y') = "aycya"
     * StringUtils.replaceChars("abcba", 'z', 'y') = "abcba"
     * </pre>
     *
     * @param searchChar the character to search for, may be null
     * @param replaceChar the character to replace, may be null
     * @return modified String, {@code null} if null string input
     * @since 2.0
     */
    public StrEx replaceChars(final char searchChar, final char replaceChar) {
        return with(StringUtils.replaceChars(str, searchChar, replaceChar));
    }

    /**
     * Replaces multiple characters in a String in one go. This method can also be used to delete
     * characters.
     * <p>
     * For example:<br>
     * {@code replaceChars(&quot;hello&quot;, &quot;ho&quot;, &quot;jy&quot;) = jelly}.
     * </p>
     * <p>
     * A {@code null} string input returns {@code null}. An empty ("") string input returns an empty
     * string. A null or empty set of search characters returns the input string.
     * </p>
     * <p>
     * The length of the search characters should normally equal the length of the replace characters.
     * If the search characters is longer, then the extra search characters are deleted. If the search
     * characters is shorter, then the extra replace characters are ignored.
     * </p>
     *
     * <pre>
     * StringUtils.replaceChars(null, *, *)           = null
     * StringUtils.replaceChars("", *, *)             = ""
     * StringUtils.replaceChars("abc", null, *)       = "abc"
     * StringUtils.replaceChars("abc", "", *)         = "abc"
     * StringUtils.replaceChars("abc", "b", null)     = "ac"
     * StringUtils.replaceChars("abc", "b", "")       = "ac"
     * StringUtils.replaceChars("abcba", "bc", "yz")  = "ayzya"
     * StringUtils.replaceChars("abcba", "bc", "y")   = "ayya"
     * StringUtils.replaceChars("abcba", "bc", "yzx") = "ayzya"
     * </pre>
     *
     * @param searchChars a set of characters to search for, may be null
     * @param replaceChars a set of characters to replace, may be null
     * @return modified String, {@code null} if null string input
     * @since 2.0
     */
    public StrEx replaceChars(final String str, final String searchChars, String replaceChars) {
        return with(StringUtils.replaceChars(str, searchChars, replaceChars));
    }

    /**
     * Replaces all occurrences of Strings within another String.
     * <p>
     * A {@code null} reference passed to this method is a no-op, or if any "search string" or "string
     * to replace" is null, that replace will be ignored. This will not repeat. For repeating replaces,
     * call the overloaded method.
     * </p>
     *
     * <pre>
     *  StringUtils.replaceEach(null, *, *)        = null
     *  StringUtils.replaceEach("", *, *)          = ""
     *  StringUtils.replaceEach("aba", null, null) = "aba"
     *  StringUtils.replaceEach("aba", new String[0], null) = "aba"
     *  StringUtils.replaceEach("aba", null, new String[0]) = "aba"
     *  StringUtils.replaceEach("aba", new String[]{"a"}, null)  = "aba"
     *  StringUtils.replaceEach("aba", new String[]{"a"}, new String[]{""})  = "b"
     *  StringUtils.replaceEach("aba", new String[]{null}, new String[]{"a"})  = "aba"
     *  StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"})  = "wcte"
     *  (example of how it does not repeat)
     *  StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"})  = "dcte"
     * </pre>
     *
     * @param searchList the Strings to search for, no-op if null
     * @param replacementList the Strings to replace them with, no-op if null
     * @return the text with any replacements processed, {@code null} if null String input
     * @throws IllegalArgumentException if the lengths of the arrays are not the same (null is ok,
     *         and/or size 0)
     * @since 2.4
     */
    public StrEx replaceEach(final String[] searchList, final String[] replacementList) {
        return with(StringUtils.replaceEach(str, searchList, replacementList));
    }

    /**
     * Replaces all occurrences of Strings within another String.
     * <p>
     * A {@code null} reference passed to this method is a no-op, or if any "search string" or "string
     * to replace" is null, that replace will be ignored.
     * </p>
     *
     * <pre>
     *  StringUtils.replaceEachRepeatedly(null, *, *) = null
     *  StringUtils.replaceEachRepeatedly("", *, *) = ""
     *  StringUtils.replaceEachRepeatedly("aba", null, null) = "aba"
     *  StringUtils.replaceEachRepeatedly("aba", new String[0], null) = "aba"
     *  StringUtils.replaceEachRepeatedly("aba", null, new String[0]) = "aba"
     *  StringUtils.replaceEachRepeatedly("aba", new String[]{"a"}, null) = "aba"
     *  StringUtils.replaceEachRepeatedly("aba", new String[]{"a"}, new String[]{""}) = "b"
     *  StringUtils.replaceEachRepeatedly("aba", new String[]{null}, new String[]{"a"}) = "aba"
     *  StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"}) = "wcte"
     *  (example of how it repeats)
     *  StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}) = "tcte"
     *  StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}) = IllegalStateException
     * </pre>
     *
     * @param searchList the Strings to search for, no-op if null
     * @param replacementList the Strings to replace them with, no-op if null
     * @return the text with any replacements processed, {@code null} if null String input
     * @throws IllegalStateException if the search is repeating and there is an endless loop due to
     *         outputs of one being inputs to another
     * @throws IllegalArgumentException if the lengths of the arrays are not the same (null is ok,
     *         and/or size 0)
     * @since 2.4
     */
    public StrEx replaceEachRepeatedly(final String[] searchList, final String[] replacementList) {
        return with(StringUtils.replaceEachRepeatedly(str, searchList, replacementList));
    }

    /**
     * Case insensitively replaces all occurrences of a String within another String.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replaceIgnoreCase(null, *, *)        = null
     * StringUtils.replaceIgnoreCase("", *, *)          = ""
     * StringUtils.replaceIgnoreCase("any", null, *)    = "any"
     * StringUtils.replaceIgnoreCase("any", *, null)    = "any"
     * StringUtils.replaceIgnoreCase("any", "", *)      = "any"
     * StringUtils.replaceIgnoreCase("aba", "a", null)  = "aba"
     * StringUtils.replaceIgnoreCase("abA", "A", "")    = "b"
     * StringUtils.replaceIgnoreCase("aba", "A", "z")   = "zbz"
     * </pre>
     *
     * @param searchString the String to search for (case-insensitive), may be null
     * @param replacement the String to replace it with, may be null
     * @return the text with any replacements processed, {@code null} if null String input
     * @since 3.5
     */
    public StrEx replaceIgnoreCase(final String searchString, final String replacement) {
        return with(StringUtils.replaceIgnoreCase(str, searchString, replacement));
    }

    /**
     * Case insensitively replaces a String with another String inside a larger String, for the first
     * {@code max} values of the search String.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replaceIgnoreCase(null, *, *, *)         = null
     * StringUtils.replaceIgnoreCase("", *, *, *)           = ""
     * StringUtils.replaceIgnoreCase("any", null, *, *)     = "any"
     * StringUtils.replaceIgnoreCase("any", *, null, *)     = "any"
     * StringUtils.replaceIgnoreCase("any", "", *, *)       = "any"
     * StringUtils.replaceIgnoreCase("any", *, *, 0)        = "any"
     * StringUtils.replaceIgnoreCase("abaa", "a", null, -1) = "abaa"
     * StringUtils.replaceIgnoreCase("abaa", "a", "", -1)   = "b"
     * StringUtils.replaceIgnoreCase("abaa", "a", "z", 0)   = "abaa"
     * StringUtils.replaceIgnoreCase("abaa", "A", "z", 1)   = "zbaa"
     * StringUtils.replaceIgnoreCase("abAa", "a", "z", 2)   = "zbza"
     * StringUtils.replaceIgnoreCase("abAa", "a", "z", -1)  = "zbzz"
     * </pre>
     *
     * @param searchString the String to search for (case-insensitive), may be null
     * @param replacement the String to replace it with, may be null
     * @param max maximum number of values to replace, or {@code -1} if no maximum
     * @return the text with any replacements processed, {@code null} if null String input
     * @since 3.5
     */
    public StrEx replaceIgnoreCase(final String searchString, final String replacement, final int max) {
        return with(StringUtils.replaceIgnoreCase(str, searchString, replacement, max));
    }

    /**
     * Replaces a String with another String inside a larger String, once.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replaceOnce(null, *, *)        = null
     * StringUtils.replaceOnce("", *, *)          = ""
     * StringUtils.replaceOnce("any", null, *)    = "any"
     * StringUtils.replaceOnce("any", *, null)    = "any"
     * StringUtils.replaceOnce("any", "", *)      = "any"
     * StringUtils.replaceOnce("aba", "a", null)  = "aba"
     * StringUtils.replaceOnce("aba", "a", "")    = "ba"
     * StringUtils.replaceOnce("aba", "a", "z")   = "zba"
     * </pre>
     *
     * @param searchString the String to search for, may be null
     * @param replacement the String to replace with, may be null
     * @return the text with any replacements processed, {@code null} if null String input
     */
    public StrEx replaceOnce(final String searchString, final String replacement) {
        return with(StringUtils.replaceOnce(str, searchString, replacement));
    }

    /**
     * Case insensitively replaces a String with another String inside a larger String, once.
     * <p>
     * A {@code null} reference passed to this method is a no-op.
     * </p>
     *
     * <pre>
     * StringUtils.replaceOnceIgnoreCase(null, *, *)        = null
     * StringUtils.replaceOnceIgnoreCase("", *, *)          = ""
     * StringUtils.replaceOnceIgnoreCase("any", null, *)    = "any"
     * StringUtils.replaceOnceIgnoreCase("any", *, null)    = "any"
     * StringUtils.replaceOnceIgnoreCase("any", "", *)      = "any"
     * StringUtils.replaceOnceIgnoreCase("aba", "a", null)  = "aba"
     * StringUtils.replaceOnceIgnoreCase("aba", "a", "")    = "ba"
     * StringUtils.replaceOnceIgnoreCase("aba", "a", "z")   = "zba"
     * StringUtils.replaceOnceIgnoreCase("FoOFoofoo", "foo", "") = "Foofoo"
     * </pre>
     *
     * @param searchString the String to search for (case-insensitive), may be null
     * @param replacement the String to replace with, may be null
     * @return the text with any replacements processed, {@code null} if null String input
     * @since 3.5
     */
    public StrEx replaceOnceIgnoreCase(final String searchString, final String replacement) {
        return with(StringUtils.replaceOnceIgnoreCase(str, searchString, replacement));
    }

    /**
     * Reverses a String as per {@link StringBuilder#reverse()}.
     * <p>
     * A {@code null} String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.reverse(null)  = null
     * StringUtils.reverse("")    = ""
     * StringUtils.reverse("bat") = "tab"
     * </pre>
     *
     * @return the reversed String, {@code null} if null String input
     */
    public StrEx reverse() {
        return with(StringUtils.reverse(str));
    }

    /**
     * Reverses a String that is delimited by a specific character.
     * <p>
     * The Strings between the delimiters are not reversed. Thus java.lang.String becomes
     * String.lang.java (if the delimiter is {@code '.'}).
     * </p>
     *
     * <pre>
     * StringUtils.reverseDelimited(null, *)      = null
     * StringUtils.reverseDelimited("", *)        = ""
     * StringUtils.reverseDelimited("a.b.c", 'x') = "a.b.c"
     * StringUtils.reverseDelimited("a.b.c", ".") = "c.b.a"
     * </pre>
     *
     * @param separatorChar the separator character to use
     * @return the reversed String, {@code null} if null String input
     * @since 2.0
     */
    public StrEx reverseDelimited(final char separatorChar) {
        return with(StringUtils.reverseDelimited(str, separatorChar));
    }

    /**
     * Gets the rightmost {@code len} characters of a String.
     * <p>
     * If {@code len} characters are not available, or the String is {@code null}, the String will be
     * returned without an an exception. An empty String is returned if len is negative.
     * </p>
     *
     * <pre>
     * StringUtils.right(null, *)    = null
     * StringUtils.right(*, -ve)     = ""
     * StringUtils.right("", *)      = ""
     * StringUtils.right("abc", 0)   = ""
     * StringUtils.right("abc", 2)   = "bc"
     * StringUtils.right("abc", 4)   = "abc"
     * </pre>
     *
     * @param len the length of the required String
     * @return the rightmost characters, {@code null} if null String input
     */
    public StrEx right(final int len) {
        return with(StringUtils.right(str, len));
    }

    /**
     * Right pad a String with spaces (' ').
     * <p>
     * The String is padded to the size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.rightPad(null, *)   = null
     * StringUtils.rightPad("", 3)     = "   "
     * StringUtils.rightPad("bat", 3)  = "bat"
     * StringUtils.rightPad("bat", 5)  = "bat  "
     * StringUtils.rightPad("bat", 1)  = "bat"
     * StringUtils.rightPad("bat", -1) = "bat"
     * </pre>
     *
     * @param size the size to pad to
     * @return right padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     */
    public StrEx rightPad(final String str, final int size) {
        return with(StringUtils.rightPad(str, size));
    }

    /**
     * Right pad a String with a specified character.
     * <p>
     * The String is padded to the size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.rightPad(null, *, *)     = null
     * StringUtils.rightPad("", 3, 'z')     = "zzz"
     * StringUtils.rightPad("bat", 3, 'z')  = "bat"
     * StringUtils.rightPad("bat", 5, 'z')  = "batzz"
     * StringUtils.rightPad("bat", 1, 'z')  = "bat"
     * StringUtils.rightPad("bat", -1, 'z') = "bat"
     * </pre>
     *
     * @param size the size to pad to
     * @param padChar the character to pad with
     * @return right padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     * @since 2.0
     */
    public StrEx rightPad(final String str, final int size, final char padChar) {
        return with(StringUtils.rightPad(str, size, padChar));
    }

    /**
     * Right pad a String with a specified String.
     * <p>
     * The String is padded to the size of {@code size}.
     * </p>
     *
     * <pre>
     * StringUtils.rightPad(null, *, *)      = null
     * StringUtils.rightPad("", 3, "z")      = "zzz"
     * StringUtils.rightPad("bat", 3, "yz")  = "bat"
     * StringUtils.rightPad("bat", 5, "yz")  = "batyz"
     * StringUtils.rightPad("bat", 8, "yz")  = "batyzyzy"
     * StringUtils.rightPad("bat", 1, "yz")  = "bat"
     * StringUtils.rightPad("bat", -1, "yz") = "bat"
     * StringUtils.rightPad("bat", 5, null)  = "bat  "
     * StringUtils.rightPad("bat", 5, "")    = "bat  "
     * </pre>
     *
     * @param size the size to pad to
     * @param padStr the String to pad with, null or empty treated as single space
     * @return right padded String or original String if no padding is necessary, {@code null} if null
     *         String input
     */
    public StrEx rightPad(final String str, final int size, String padStr) {
        return with(StringUtils.rightPad(str, size, padStr));
    }

    /**
     * Rotate (circular shift) a String of {@code shift} characters.
     * <ul>
     * <li>If {@code shift > 0}, right circular shift (ex : ABCDEF =&gt; FABCDE)</li>
     * <li>If {@code shift < 0}, left circular shift (ex : ABCDEF =&gt; BCDEFA)</li>
     * </ul>
     *
     * <pre>
     * StringUtils.rotate(null, *)        = null
     * StringUtils.rotate("", *)          = ""
     * StringUtils.rotate("abcdefg", 0)   = "abcdefg"
     * StringUtils.rotate("abcdefg", 2)   = "fgabcde"
     * StringUtils.rotate("abcdefg", -2)  = "cdefgab"
     * StringUtils.rotate("abcdefg", 7)   = "abcdefg"
     * StringUtils.rotate("abcdefg", -7)  = "abcdefg"
     * StringUtils.rotate("abcdefg", 9)   = "fgabcde"
     * StringUtils.rotate("abcdefg", -9)  = "cdefgab"
     * </pre>
     *
     * @param shift number of time to shift (positive : right shift, negative : left shift)
     * @return the rotated String, or the original String if {@code shift == 0}, or {@code null} if null
     *         String input
     * @since 3.5
     */
    public StrEx rotate(final int shift) {
        return with(StringUtils.rotate(str, shift));
    }

    /**
     * Splits the provided text into an array, using whitespace as the separator. Whitespace is defined
     * by {@link Character#isWhitespace(char)}.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * one separator. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.split(null)       = null
     * StringUtils.split("")         = []
     * StringUtils.split("abc def")  = ["abc", "def"]
     * StringUtils.split("abc  def") = ["abc", "def"]
     * StringUtils.split(" abc ")    = ["abc"]
     * </pre>
     *
     * @return an array of parsed Strings, {@code null} if null String input
     */
    public String[] split() {
        return StringUtils.split(str);
    }

    /**
     * Splits the provided text into an array, separator specified. This is an alternative to using
     * StringTokenizer.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * one separator. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.split(null, *)         = null
     * StringUtils.split("", *)           = []
     * StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
     * StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
     * StringUtils.split("a:b:c", '.')    = ["a:b:c"]
     * StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
     * </pre>
     *
     * @param separatorChar the character used as the delimiter
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.0
     */
    public String[] split(final char separatorChar) {
        return StringUtils.split(str, separatorChar);
    }

    /**
     * Splits the provided text into an array, separators specified. This is an alternative to using
     * StringTokenizer.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * one separator. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separatorChars splits on
     * whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.split(null, *)         = null
     * StringUtils.split("", *)           = []
     * StringUtils.split("abc def", null) = ["abc", "def"]
     * StringUtils.split("abc def", " ")  = ["abc", "def"]
     * StringUtils.split("abc  def", " ") = ["abc", "def"]
     * StringUtils.split("ab:cd:ef", ":") = ["ab", "cd", "ef"]
     * </pre>
     *
     * @param separatorChars the characters used as the delimiters, {@code null} splits on whitespace
     * @return an array of parsed Strings, {@code null} if null String input
     */
    public String[] split(final String separatorChars) {
        return StringUtils.split(str, separatorChars);
    }

    /**
     * Splits the provided text into an array with a maximum length, separators specified.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * one separator.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separatorChars splits on
     * whitespace.
     * </p>
     * <p>
     * If more than {@code max} delimited substrings are found, the last returned string includes all
     * characters after the first {@code max - 1} returned strings (including separator characters).
     * </p>
     *
     * <pre>
     * StringUtils.split(null, *, *)            = null
     * StringUtils.split("", *, *)              = []
     * StringUtils.split("ab cd ef", null, 0)   = ["ab", "cd", "ef"]
     * StringUtils.split("ab   cd ef", null, 0) = ["ab", "cd", "ef"]
     * StringUtils.split("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
     * StringUtils.split("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
     * </pre>
     *
     * @param separatorChars the characters used as the delimiters, {@code null} splits on whitespace
     * @param max the maximum number of elements to include in the array. A zero or negative value
     *        implies no limit
     * @return an array of parsed Strings, {@code null} if null String input
     */
    public String[] split(final String separatorChars, final int max) {
        return StringUtils.split(str, separatorChars, max);
    }

    /**
     * Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}.
     * Groups of contiguous characters of the same type are returned as complete tokens.
     * 
     * <pre>
     * StringUtils.splitByCharacterType(null)         = null
     * StringUtils.splitByCharacterType("")           = []
     * StringUtils.splitByCharacterType("ab de fg")   = ["ab", " ", "de", " ", "fg"]
     * StringUtils.splitByCharacterType("ab   de fg") = ["ab", "   ", "de", " ", "fg"]
     * StringUtils.splitByCharacterType("ab:cd:ef")   = ["ab", ":", "cd", ":", "ef"]
     * StringUtils.splitByCharacterType("number5")    = ["number", "5"]
     * StringUtils.splitByCharacterType("fooBar")     = ["foo", "B", "ar"]
     * StringUtils.splitByCharacterType("foo200Bar")  = ["foo", "200", "B", "ar"]
     * StringUtils.splitByCharacterType("ASFRules")   = ["ASFR", "ules"]
     * </pre>
     *
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.4
     */
    public String[] splitByCharacterType() {
        return StringUtils.splitByCharacterType(str);
    }

    /**
     * <p>
     * Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}.
     * Groups of contiguous characters of the same type are returned as complete tokens, with the
     * following exception: the character of type {@code Character.UPPERCASE_LETTER}, if any,
     * immediately preceding a token of type {@code Character.LOWERCASE_LETTER} will belong to the
     * following token rather than to the preceding, if any, {@code Character.UPPERCASE_LETTER} token.
     * 
     * <pre>
     * StringUtils.splitByCharacterTypeCamelCase(null)         = null
     * StringUtils.splitByCharacterTypeCamelCase("")           = []
     * StringUtils.splitByCharacterTypeCamelCase("ab de fg")   = ["ab", " ", "de", " ", "fg"]
     * StringUtils.splitByCharacterTypeCamelCase("ab   de fg") = ["ab", "   ", "de", " ", "fg"]
     * StringUtils.splitByCharacterTypeCamelCase("ab:cd:ef")   = ["ab", ":", "cd", ":", "ef"]
     * StringUtils.splitByCharacterTypeCamelCase("number5")    = ["number", "5"]
     * StringUtils.splitByCharacterTypeCamelCase("fooBar")     = ["foo", "Bar"]
     * StringUtils.splitByCharacterTypeCamelCase("foo200Bar")  = ["foo", "200", "Bar"]
     * StringUtils.splitByCharacterTypeCamelCase("ASFRules")   = ["ASF", "Rules"]
     * </pre>
     *
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.4
     */
    public String[] splitByCharacterTypeCamelCase() {
        return StringUtils.splitByCharacterTypeCamelCase(str);
    }

    /**
     * <p>
     * Splits the provided text into an array, separator string specified.
     * <p>
     * The separator(s) will not be included in the returned String array. Adjacent separators are
     * treated as one separator.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separator splits on whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.splitByWholeSeparator(null, *)               = null
     * StringUtils.splitByWholeSeparator("", *)                 = []
     * StringUtils.splitByWholeSeparator("ab de fg", null)      = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparator("ab   de fg", null)    = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparator("ab:cd:ef", ":")       = ["ab", "cd", "ef"]
     * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-") = ["ab", "cd", "ef"]
     * </pre>
     *
     * @param separator String containing the String to be used as a delimiter, {@code null} splits on
     *        whitespace
     * @return an array of parsed Strings, {@code null} if null String was input
     */
    public String[] splitByWholeSeparator(final String separator) {
        return StringUtils.splitByWholeSeparator(str, separator);
    }

    /**
     * Splits the provided text into an array, separator string specified. Returns a maximum of
     * {@code max} substrings.
     * <p>
     * The separator(s) will not be included in the returned String array. Adjacent separators are
     * treated as one separator.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separator splits on whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.splitByWholeSeparator(null, *, *)               = null
     * StringUtils.splitByWholeSeparator("", *, *)                 = []
     * StringUtils.splitByWholeSeparator("ab de fg", null, 0)      = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparator("ab   de fg", null, 0)    = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparator("ab:cd:ef", ":", 2)       = ["ab", "cd:ef"]
     * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 5) = ["ab", "cd", "ef"]
     * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 2) = ["ab", "cd-!-ef"]
     * </pre>
     *
     * @param separator String containing the String to be used as a delimiter, {@code null} splits on
     *        whitespace
     * @param max the maximum number of elements to include in the returned array. A zero or negative
     *        value implies no limit.
     * @return an array of parsed Strings, {@code null} if null String was input
     */
    public String[] splitByWholeSeparator(final String separator, final int max) {
        return StringUtils.splitByWholeSeparator(str, separator, max);
    }

    /**
     * Splits the provided text into an array, separator string specified.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separator splits on whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.splitByWholeSeparatorPreserveAllTokens(null, *)               = null
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("", *)                 = []
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab de fg", null)      = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab   de fg", null)    = ["ab", "", "", "de", "fg"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab:cd:ef", ":")       = ["ab", "cd", "ef"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab-!-cd-!-ef", "-!-") = ["ab", "cd", "ef"]
     * </pre>
     *
     * @param separator String containing the String to be used as a delimiter, {@code null} splits on
     *        whitespace
     * @return an array of parsed Strings, {@code null} if null String was input
     * @since 2.4
     */
    public String[] splitByWholeSeparatorPreserveAllTokens(final String separator) {
        return StringUtils.splitByWholeSeparatorPreserveAllTokens(str, separator);
    }

    /**
     * Splits the provided text into an array, separator string specified. Returns a maximum of
     * {@code max} substrings.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separator splits on whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.splitByWholeSeparatorPreserveAllTokens(null, *, *)               = null
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("", *, *)                 = []
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab de fg", null, 0)      = ["ab", "de", "fg"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab   de fg", null, 0)    = ["ab", "", "", "de", "fg"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab:cd:ef", ":", 2)       = ["ab", "cd:ef"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab-!-cd-!-ef", "-!-", 5) = ["ab", "cd", "ef"]
     * StringUtils.splitByWholeSeparatorPreserveAllTokens("ab-!-cd-!-ef", "-!-", 2) = ["ab", "cd-!-ef"]
     * </pre>
     *
     * @param separator String containing the String to be used as a delimiter, {@code null} splits on
     *        whitespace
     * @param max the maximum number of elements to include in the returned array. A zero or negative
     *        value implies no limit.
     * @return an array of parsed Strings, {@code null} if null String was input
     * @since 2.4
     */
    public String[] splitByWholeSeparatorPreserveAllTokens(final String separator, final int max) {
        return StringUtils.splitByWholeSeparatorPreserveAllTokens(str, separator, max);
    }

    /**
     * Splits the provided text into an array, using whitespace as the separator, preserving all tokens,
     * including empty tokens created by adjacent separators. This is an alternative to using
     * StringTokenizer. Whitespace is defined by {@link Character#isWhitespace(char)}.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.splitPreserveAllTokens(null)       = null
     * StringUtils.splitPreserveAllTokens("")         = []
     * StringUtils.splitPreserveAllTokens("abc def")  = ["abc", "def"]
     * StringUtils.splitPreserveAllTokens("abc  def") = ["abc", "", "def"]
     * StringUtils.splitPreserveAllTokens(" abc ")    = ["", "abc", ""]
     * </pre>
     *
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.1
     */
    public String[] splitPreserveAllTokens() {
        return StringUtils.splitPreserveAllTokens(str);
    }

    /**
     * Splits the provided text into an array, separator specified, preserving all tokens, including
     * empty tokens created by adjacent separators. This is an alternative to using StringTokenizer.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.splitPreserveAllTokens(null, *)         = null
     * StringUtils.splitPreserveAllTokens("", *)           = []
     * StringUtils.splitPreserveAllTokens("a.b.c", '.')    = ["a", "b", "c"]
     * StringUtils.splitPreserveAllTokens("a..b.c", '.')   = ["a", "", "b", "c"]
     * StringUtils.splitPreserveAllTokens("a:b:c", '.')    = ["a:b:c"]
     * StringUtils.splitPreserveAllTokens("a\tb\nc", null) = ["a", "b", "c"]
     * StringUtils.splitPreserveAllTokens("a b c", ' ')    = ["a", "b", "c"]
     * StringUtils.splitPreserveAllTokens("a b c ", ' ')   = ["a", "b", "c", ""]
     * StringUtils.splitPreserveAllTokens("a b c  ", ' ')   = ["a", "b", "c", "", ""]
     * StringUtils.splitPreserveAllTokens(" a b c", ' ')   = ["", a", "b", "c"]
     * StringUtils.splitPreserveAllTokens("  a b c", ' ')  = ["", "", a", "b", "c"]
     * StringUtils.splitPreserveAllTokens(" a b c ", ' ')  = ["", a", "b", "c", ""]
     * </pre>
     *
     * @param separatorChar the character used as the delimiter, {@code null} splits on whitespace
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.1
     */
    public String[] splitPreserveAllTokens(final String str, final char separatorChar) {
        return StringUtils.splitPreserveAllTokens(str, separatorChar);
    }

    /**
     * Splits the provided text into an array, separators specified, preserving all tokens, including
     * empty tokens created by adjacent separators. This is an alternative to using StringTokenizer.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. For more control over the split use the StrTokenizer class.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separatorChars splits on
     * whitespace.
     * </p>
     *
     * <pre>
     * StringUtils.splitPreserveAllTokens(null, *)           = null
     * StringUtils.splitPreserveAllTokens("", *)             = []
     * StringUtils.splitPreserveAllTokens("abc def", null)   = ["abc", "def"]
     * StringUtils.splitPreserveAllTokens("abc def", " ")    = ["abc", "def"]
     * StringUtils.splitPreserveAllTokens("abc  def", " ")   = ["abc", "", def"]
     * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":")   = ["ab", "cd", "ef"]
     * StringUtils.splitPreserveAllTokens("ab:cd:ef:", ":")  = ["ab", "cd", "ef", ""]
     * StringUtils.splitPreserveAllTokens("ab:cd:ef::", ":") = ["ab", "cd", "ef", "", ""]
     * StringUtils.splitPreserveAllTokens("ab::cd:ef", ":")  = ["ab", "", cd", "ef"]
     * StringUtils.splitPreserveAllTokens(":cd:ef", ":")     = ["", cd", "ef"]
     * StringUtils.splitPreserveAllTokens("::cd:ef", ":")    = ["", "", cd", "ef"]
     * StringUtils.splitPreserveAllTokens(":cd:ef:", ":")    = ["", cd", "ef", ""]
     * </pre>
     *
     * @param separatorChars the characters used as the delimiters, {@code null} splits on whitespace
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.1
     */
    public String[] splitPreserveAllTokens(final String separatorChars) {
        return StringUtils.splitPreserveAllTokens(str, separatorChars);
    }

    /**
     * Splits the provided text into an array with a maximum length, separators specified, preserving
     * all tokens, including empty tokens created by adjacent separators.
     * <p>
     * The separator is not included in the returned String array. Adjacent separators are treated as
     * separators for empty tokens. Adjacent separators are treated as one separator.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} separatorChars splits on
     * whitespace.
     * </p>
     * <p>
     * If more than {@code max} delimited substrings are found, the last returned string includes all
     * characters after the first {@code max - 1} returned strings (including separator characters).
     * </p>
     *
     * <pre>
     * StringUtils.splitPreserveAllTokens(null, *, *)            = null
     * StringUtils.splitPreserveAllTokens("", *, *)              = []
     * StringUtils.splitPreserveAllTokens("ab de fg", null, 0)   = ["ab", "de", "fg"]
     * StringUtils.splitPreserveAllTokens("ab   de fg", null, 0) = ["ab", "", "", "de", "fg"]
     * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
     * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
     * StringUtils.splitPreserveAllTokens("ab   de fg", null, 2) = ["ab", "  de fg"]
     * StringUtils.splitPreserveAllTokens("ab   de fg", null, 3) = ["ab", "", " de fg"]
     * StringUtils.splitPreserveAllTokens("ab   de fg", null, 4) = ["ab", "", "", "de fg"]
     * </pre>
     *
     * @param separatorChars the characters used as the delimiters, {@code null} splits on whitespace
     * @param max the maximum number of elements to include in the array. A zero or negative value
     *        implies no limit
     * @return an array of parsed Strings, {@code null} if null String input
     * @since 2.1
     */
    public String[] splitPreserveAllTokens(final String separatorChars, final int max) {
        return StringUtils.splitPreserveAllTokens(str, separatorChars, max);
    }

    /**
     * Check if a CharSequence starts with a specified prefix.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered to be
     * equal. The comparison is case-sensitive.
     * </p>
     *
     * <pre>
     * StringUtils.startsWith(null, null)      = true
     * StringUtils.startsWith(null, "abc")     = false
     * StringUtils.startsWith("abcdef", null)  = false
     * StringUtils.startsWith("abcdef", "abc") = true
     * StringUtils.startsWith("ABCDEF", "abc") = false
     * </pre>
     *
     * @param prefix the prefix to find, may be null
     * @return {@code true} if the CharSequence starts with the prefix, case-sensitive, or both
     *         {@code null}
     * @see String#startsWith(String)
     * @since 2.4
     * @since 3.0 Changed signature from startsWith(String, String) to startsWith(CharSequence,
     *        CharSequence)
     */
    public boolean startsWith(final CharSequence prefix) {
        return StringUtils.startsWith(str, prefix);
    }

    /**
     * Check if a CharSequence starts with any of the provided case-sensitive prefixes.
     *
     * <pre>
     * StringUtils.startsWithAny(null, null)      = false
     * StringUtils.startsWithAny(null, new String[] {"abc"})  = false
     * StringUtils.startsWithAny("abcxyz", null)     = false
     * StringUtils.startsWithAny("abcxyz", new String[] {""}) = true
     * StringUtils.startsWithAny("abcxyz", new String[] {"abc"}) = true
     * StringUtils.startsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true
     * StringUtils.startsWithAny("abcxyz", null, "xyz", "ABCX") = false
     * StringUtils.startsWithAny("ABCXYZ", null, "xyz", "abc") = false
     * </pre>
     *
     * @param searchStrings the case-sensitive CharSequence prefixes, may be empty or contain
     *        {@code null}
     * @return {@code true} if the input {@code sequence} is {@code null} AND no {@code searchStrings}
     *         are provided, or the input {@code sequence} begins with any of the provided
     *         case-sensitive {@code searchStrings}.
     * @see StringUtils#startsWith(CharSequence, CharSequence)
     * @since 2.5
     * @since 3.0 Changed signature from startsWithAny(String, String[]) to startsWithAny(CharSequence,
     *        CharSequence...)
     */
    public boolean startsWithAny(final CharSequence... searchStrings) {
        return StringUtils.startsWithAny(str, searchStrings);
    }

    /**
     * Case insensitive check if a CharSequence starts with a specified prefix.
     * <p>
     * {@code null}s are handled without exceptions. Two {@code null} references are considered to be
     * equal. The comparison is case insensitive.
     * </p>
     *
     * <pre>
     * StringUtils.startsWithIgnoreCase(null, null)      = true
     * StringUtils.startsWithIgnoreCase(null, "abc")     = false
     * StringUtils.startsWithIgnoreCase("abcdef", null)  = false
     * StringUtils.startsWithIgnoreCase("abcdef", "abc") = true
     * StringUtils.startsWithIgnoreCase("ABCDEF", "abc") = true
     * </pre>
     *
     * @param prefix the prefix to find, may be null
     * @return {@code true} if the CharSequence starts with the prefix, case-insensitive, or both
     *         {@code null}
     * @see String#startsWith(String)
     * @since 2.4
     * @since 3.0 Changed signature from startsWithIgnoreCase(String, String) to
     *        startsWithIgnoreCase(CharSequence, CharSequence)
     */
    public boolean startsWithIgnoreCase(final CharSequence prefix) {
        return StringUtils.startsWithIgnoreCase(str, prefix);
    }

    /**
     * Strips whitespace from the start and end of a String.
     * <p>
     * This is similar to {#trim(String)} but removes whitespace. Whitespace is defined by
     * {@link Character#isWhitespace(char)}.
     * </p>
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.strip(null)     = null
     * StringUtils.strip("")       = ""
     * StringUtils.strip("   ")    = ""
     * StringUtils.strip("abc")    = "abc"
     * StringUtils.strip("  abc")  = "abc"
     * StringUtils.strip("abc  ")  = "abc"
     * StringUtils.strip(" abc ")  = "abc"
     * StringUtils.strip(" ab c ") = "ab c"
     * </pre>
     *
     * @return the stripped String, {@code null} if null String input
     */
    public StrEx strip() {
        return with(StringUtils.strip(str));
    }

    /**
     * Strips any of a set of characters from the start and end of a String. This is similar to
     * {@link String#trim()} but allows the characters to be stripped to be controlled.
     * <p>
     * A {@code null} input String returns {@code null}. An empty string ("") input returns the empty
     * string.
     * </p>
     * <p>
     * If the stripChars String is {@code null}, whitespace is stripped as defined by
     * {@link Character#isWhitespace(char)}. Alternatively use {@link #strip(String)}.
     * </p>
     *
     * <pre>
     * StringUtils.strip(null, *)          = null
     * StringUtils.strip("", *)            = ""
     * StringUtils.strip("abc", null)      = "abc"
     * StringUtils.strip("  abc", null)    = "abc"
     * StringUtils.strip("abc  ", null)    = "abc"
     * StringUtils.strip(" abc ", null)    = "abc"
     * StringUtils.strip("  abcyx", "xyz") = "  abc"
     * </pre>
     *
     * @param stripChars the characters to remove, null treated as whitespace
     * @return the stripped String, {@code null} if null String input
     */
    public StrEx strip(final String stripChars) {
        return with(StringUtils.strip(str, stripChars));
    }

    /**
     * Removes diacritics (~= accents) from a string. The case will not be altered.
     * <p>
     * For instance, '&agrave;' will be replaced by 'a'.
     * </p>
     * <p>
     * Note that ligatures will be left as is.
     * </p>
     *
     * <pre>
     * StringUtils.stripAccents(null)                = null
     * StringUtils.stripAccents("")                  = ""
     * StringUtils.stripAccents("control")           = "control"
     * StringUtils.stripAccents("&eacute;clair")     = "eclair"
     * </pre>
     *
     * @return input text with diacritics removed
     * @since 3.0
     */
    // See also Lucene's ASCIIFoldingFilter (Lucene 2.9) that replaces accented characters by their
    // unaccented equivalent (and uncommitted bug fix:
    // https://issues.apache.org/jira/browse/LUCENE-1343?focusedCommentId=12858907&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12858907).
    public StrEx stripAccents(final String input) {
        return with(StringUtils.stripAccents(str));
    }

    /**
     * Strips any of a set of characters from the end of a String.
     * <p>
     * A {@code null} input String returns {@code null}. An empty string ("") input returns the empty
     * string.
     * </p>
     * <p>
     * If the stripChars String is {@code null}, whitespace is stripped as defined by
     * {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.stripEnd(null, *)          = null
     * StringUtils.stripEnd("", *)            = ""
     * StringUtils.stripEnd("abc", "")        = "abc"
     * StringUtils.stripEnd("abc", null)      = "abc"
     * StringUtils.stripEnd("  abc", null)    = "  abc"
     * StringUtils.stripEnd("abc  ", null)    = "abc"
     * StringUtils.stripEnd(" abc ", null)    = " abc"
     * StringUtils.stripEnd("  abcyx", "xyz") = "  abc"
     * StringUtils.stripEnd("120.00", ".0")   = "12"
     * </pre>
     *
     * @param stripChars the set of characters to remove, null treated as whitespace
     * @return the stripped String, {@code null} if null String input
     */
    public StrEx stripEnd(final String stripChars) {
        return with(StringUtils.stripEnd(str, stripChars));
    }

    /**
     * Strips any of a set of characters from the start of a String.
     * <p>
     * A {@code null} input String returns {@code null}. An empty string ("") input returns the empty
     * string.
     * </p>
     * <p>
     * If the stripChars String is {@code null}, whitespace is stripped as defined by
     * {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.stripStart(null, *)          = null
     * StringUtils.stripStart("", *)            = ""
     * StringUtils.stripStart("abc", "")        = "abc"
     * StringUtils.stripStart("abc", null)      = "abc"
     * StringUtils.stripStart("  abc", null)    = "abc"
     * StringUtils.stripStart("abc  ", null)    = "abc  "
     * StringUtils.stripStart(" abc ", null)    = "abc "
     * StringUtils.stripStart("yxabc  ", "xyz") = "abc  "
     * </pre>
     *
     * @param stripChars the characters to remove, null treated as whitespace
     * @return the stripped String, {@code null} if null String input
     */
    public StrEx stripStart(final String stripChars) {
        return with(StringUtils.stripStart(str, stripChars));
    }

    /**
     * Strips whitespace from the start and end of a String returning an empty String if {@code null}
     * input.
     * <p>
     * This is similar to {#trimToEmpty(String)} but removes whitespace. Whitespace is defined by
     * {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.stripToEmpty(null)     = ""
     * StringUtils.stripToEmpty("")       = ""
     * StringUtils.stripToEmpty("   ")    = ""
     * StringUtils.stripToEmpty("abc")    = "abc"
     * StringUtils.stripToEmpty("  abc")  = "abc"
     * StringUtils.stripToEmpty("abc  ")  = "abc"
     * StringUtils.stripToEmpty(" abc ")  = "abc"
     * StringUtils.stripToEmpty(" ab c ") = "ab c"
     * </pre>
     *
     * @return the trimmed String, or an empty String if {@code null} input
     * @since 2.0
     */
    public StrEx stripToEmpty() {
        return with(StringUtils.stripToEmpty(str));
    }

    /**
     * Strips whitespace from the start and end of a String returning {@code null} if the String is
     * empty ("") after the strip.
     * <p>
     * This is similar to {#trimToNull(String)} but removes whitespace. Whitespace is defined by
     * {@link Character#isWhitespace(char)}.
     * </p>
     *
     * <pre>
     * StringUtils.stripToNull(null)     = null
     * StringUtils.stripToNull("")       = null
     * StringUtils.stripToNull("   ")    = null
     * StringUtils.stripToNull("abc")    = "abc"
     * StringUtils.stripToNull("  abc")  = "abc"
     * StringUtils.stripToNull("abc  ")  = "abc"
     * StringUtils.stripToNull(" abc ")  = "abc"
     * StringUtils.stripToNull(" ab c ") = "ab c"
     * </pre>
     *
     * @return the stripped String, {@code null} if whitespace, empty or null String input
     * @since 2.0
     */
    public StrEx stripToNull(String str) {
        return with(StringUtils.stripToNull(str));
    }

    /**
     * Gets a substring from the specified String avoiding exceptions.
     * <p>
     * A negative start position can be used to start {@code n} characters from the end of the String.
     * </p>
     * <p>
     * A {@code null} String will return {@code null}. An empty ("") String will return "".
     * </p>
     *
     * <pre>
     * StringUtils.substring(null, *)   = null
     * StringUtils.substring("", *)     = ""
     * StringUtils.substring("abc", 0)  = "abc"
     * StringUtils.substring("abc", 2)  = "c"
     * StringUtils.substring("abc", 4)  = ""
     * StringUtils.substring("abc", -2) = "bc"
     * StringUtils.substring("abc", -4) = "abc"
     * </pre>
     *
     * @param start the position to start from, negative means count back from the end of the String by
     *        this many characters
     * @return substring from start position, {@code null} if null String input
     */
    public StrEx substring(int start) {
        return with(StringUtils.substring(str, start));
    }

    /**
     * Gets a substring from the specified String avoiding exceptions.
     * <p>
     * A negative start position can be used to start/end {@code n} characters from the end of the
     * String.
     * </p>
     * <p>
     * The returned substring starts with the character in the {@code start} position and ends before
     * the {@code end} position. All position counting is zero-based -- i.e., to start at the beginning
     * of the string use {@code start = 0}. Negative start and end positions can be used to specify
     * offsets relative to the end of the String.
     * </p>
     * <p>
     * If {@code start} is not strictly to the left of {@code end}, "" is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substring(null, *, *)    = null
     * StringUtils.substring("", * ,  *)    = "";
     * StringUtils.substring("abc", 0, 2)   = "ab"
     * StringUtils.substring("abc", 2, 0)   = ""
     * StringUtils.substring("abc", 2, 4)   = "c"
     * StringUtils.substring("abc", 4, 6)   = ""
     * StringUtils.substring("abc", 2, 2)   = ""
     * StringUtils.substring("abc", -2, -1) = "b"
     * StringUtils.substring("abc", -4, 2)  = "ab"
     * </pre>
     *
     * @param start the position to start from, negative means count back from the end of the String by
     *        this many characters
     * @param end the position to end at (exclusive), negative means count back from the end of the
     *        String by this many characters
     * @return substring from start position to end position, {@code null} if null String input
     */
    public StrEx substring(int start, int end) {
        return with(StringUtils.substring(str, start, end));
    }

    /**
     * Gets the substring after the first occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string.
     * <p>
     * If nothing is found, the empty string is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringAfter(null, *)      = null
     * StringUtils.substringAfter("", *)        = ""
     * StringUtils.substringAfter("abc", 'a')   = "bc"
     * StringUtils.substringAfter("abcba", 'b') = "cba"
     * StringUtils.substringAfter("abc", 'c')   = ""
     * StringUtils.substringAfter("abc", 'd')   = ""
     * StringUtils.substringAfter(" abc", 32)   = "abc"
     * </pre>
     *
     * @param separator the character (Unicode code point) to search.
     * @return the substring after the first occurrence of the separator, {@code null} if null String
     *         input
     * @since 3.11
     */
    public StrEx substringAfter(final String str, final int separator) {
        return with(StringUtils.substringAfter(str, separator));
    }

    /**
     * Gets the substring after the first occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string. A {@code null} separator will return the empty string if the input string is not
     * {@code null}.
     * </p>
     * <p>
     * If nothing is found, the empty string is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringAfter(null, *)      = null
     * StringUtils.substringAfter("", *)        = ""
     * StringUtils.substringAfter(*, null)      = ""
     * StringUtils.substringAfter("abc", "a")   = "bc"
     * StringUtils.substringAfter("abcba", "b") = "cba"
     * StringUtils.substringAfter("abc", "c")   = ""
     * StringUtils.substringAfter("abc", "d")   = ""
     * StringUtils.substringAfter("abc", "")    = "abc"
     * </pre>
     *
     * @param separator the String to search for, may be null
     * @return the substring after the first occurrence of the separator, {@code null} if null String
     *         input
     * @since 2.0
     */
    public StrEx substringAfter(final String separator) {
        return with(StringUtils.substringAfter(str, separator));
    }

    /**
     * Gets the substring after the last occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string.
     * <p>
     * If nothing is found, the empty string is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringAfterLast(null, *)      = null
     * StringUtils.substringAfterLast("", *)        = ""
     * StringUtils.substringAfterLast("abc", 'a')   = "bc"
     * StringUtils.substringAfterLast(" bc", 32)    = "bc"
     * StringUtils.substringAfterLast("abcba", 'b') = "a"
     * StringUtils.substringAfterLast("abc", 'c')   = ""
     * StringUtils.substringAfterLast("a", 'a')     = ""
     * StringUtils.substringAfterLast("a", 'z')     = ""
     * </pre>
     *
     * @param separator the character (Unicode code point) to search.
     * @return the substring after the last occurrence of the separator, {@code null} if null String
     *         input
     * @since 3.11
     */
    public StrEx substringAfterLast(final int separator) {
        return with(StringUtils.substringAfterLast(str, separator));
    }

    /**
     * Gets the substring after the last occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string. An empty or {@code null} separator will return the empty string if the input string
     * is not {@code null}.
     * </p>
     * <p>
     * If nothing is found, the empty string is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringAfterLast(null, *)      = null
     * StringUtils.substringAfterLast("", *)        = ""
     * StringUtils.substringAfterLast(*, "")        = ""
     * StringUtils.substringAfterLast(*, null)      = ""
     * StringUtils.substringAfterLast("abc", "a")   = "bc"
     * StringUtils.substringAfterLast("abcba", "b") = "a"
     * StringUtils.substringAfterLast("abc", "c")   = ""
     * StringUtils.substringAfterLast("a", "a")     = ""
     * StringUtils.substringAfterLast("a", "z")     = ""
     * </pre>
     *
     * @param separator the String to search for, may be null
     * @return the substring after the last occurrence of the separator, {@code null} if null String
     *         input
     * @since 2.0
     */
    public StrEx substringAfterLast(final String separator) {
        return with(StringUtils.substringAfterLast(str, separator));
    }

    /**
     * Gets the substring before the first occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string.
     * </p>
     * <p>
     * If nothing is found, the string input is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringBefore(null, *)      = null
     * StringUtils.substringBefore("", *)        = ""
     * StringUtils.substringBefore("abc", 'a')   = ""
     * StringUtils.substringBefore("abcba", 'b') = "a"
     * StringUtils.substringBefore("abc", 'c')   = "ab"
     * StringUtils.substringBefore("abc", 'd')   = "abc"
     * </pre>
     *
     * @param separator the character (Unicode code point) to search.
     * @return the substring before the first occurrence of the separator, {@code null} if null String
     *         input
     * @since 3.12.0
     */
    public StrEx substringBefore(final int separator) {
        return with(StringUtils.substringBefore(str, separator));
    }

    /**
     * Gets the substring before the first occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string. A {@code null} separator will return the input string.
     * </p>
     * <p>
     * If nothing is found, the string input is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringBefore(null, *)      = null
     * StringUtils.substringBefore("", *)        = ""
     * StringUtils.substringBefore("abc", "a")   = ""
     * StringUtils.substringBefore("abcba", "b") = "a"
     * StringUtils.substringBefore("abc", "c")   = "ab"
     * StringUtils.substringBefore("abc", "d")   = "abc"
     * StringUtils.substringBefore("abc", "")    = ""
     * StringUtils.substringBefore("abc", null)  = "abc"
     * </pre>
     *
     * @param separator the String to search for, may be null
     * @return the substring before the first occurrence of the separator, {@code null} if null String
     *         input
     * @since 2.0
     */
    public StrEx substringBefore(final String separator) {
        return with(StringUtils.substringBefore(str, separator));
    }

    /**
     * Gets the substring before the last occurrence of a separator. The separator is not returned.
     * <p>
     * A {@code null} string input will return {@code null}. An empty ("") string input will return the
     * empty string. An empty or {@code null} separator will return the input string.
     * </p>
     * <p>
     * If nothing is found, the string input is returned.
     * </p>
     *
     * <pre>
     * StringUtils.substringBeforeLast(null, *)      = null
     * StringUtils.substringBeforeLast("", *)        = ""
     * StringUtils.substringBeforeLast("abcba", "b") = "abc"
     * StringUtils.substringBeforeLast("abc", "c")   = "ab"
     * StringUtils.substringBeforeLast("a", "a")     = ""
     * StringUtils.substringBeforeLast("a", "z")     = "a"
     * StringUtils.substringBeforeLast("a", null)    = "a"
     * StringUtils.substringBeforeLast("a", "")      = "a"
     * </pre>
     *
     * @param separator the String to search for, may be null
     * @return the substring before the last occurrence of the separator, {@code null} if null String
     *         input
     * @since 2.0
     */
    public StrEx substringBeforeLast(final String separator) {
        return with(StringUtils.substringBeforeLast(str, separator));
    }

    /**
     * Gets the String that is nested in between two instances of the same String.
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} tag returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.substringBetween(null, *)            = null
     * StringUtils.substringBetween("", "")             = ""
     * StringUtils.substringBetween("", "tag")          = null
     * StringUtils.substringBetween("tagabctag", null)  = null
     * StringUtils.substringBetween("tagabctag", "")    = ""
     * StringUtils.substringBetween("tagabctag", "tag") = "abc"
     * </pre>
     *
     * @param tag the String before and after the substring, may be null
     * @return the substring, {@code null} if no match
     * @since 2.0
     */
    public StrEx substringBetween(final String tag) {
        return with(StringUtils.substringBetween(str, tag));
    }

    /**
     * Gets the String that is nested in between two Strings. Only the first match is returned.
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} open/close returns {@code null}
     * (no match). An empty ("") open and close returns an empty string.
     * </p>
     *
     * <pre>
     * StringUtils.substringBetween("wx[b]yz", "[", "]") = "b"
     * StringUtils.substringBetween(null, *, *)          = null
     * StringUtils.substringBetween(*, null, *)          = null
     * StringUtils.substringBetween(*, *, null)          = null
     * StringUtils.substringBetween("", "", "")          = ""
     * StringUtils.substringBetween("", "", "]")         = null
     * StringUtils.substringBetween("", "[", "]")        = null
     * StringUtils.substringBetween("yabcz", "", "")     = ""
     * StringUtils.substringBetween("yabcz", "y", "z")   = "abc"
     * StringUtils.substringBetween("yabczyabcz", "y", "z")   = "abc"
     * </pre>
     *
     * @param open the String before the substring, may be null
     * @param close the String after the substring, may be null
     * @return the substring, {@code null} if no match
     * @since 2.0
     */
    public StrEx substringBetween(final String open, final String close) {
        return with(StringUtils.substringBetween(str, open, close));
    }

    /**
     * Searches a String for substrings delimited by a start and end tag, returning all matching
     * substrings in an array.
     * <p>
     * A {@code null} input String returns {@code null}. A {@code null} open/close returns {@code null}
     * (no match). An empty ("") open/close returns {@code null} (no match).
     * </p>
     *
     * <pre>
     * StringUtils.substringsBetween("[a][b][c]", "[", "]") = ["a","b","c"]
     * StringUtils.substringsBetween(null, *, *)            = null
     * StringUtils.substringsBetween(*, null, *)            = null
     * StringUtils.substringsBetween(*, *, null)            = null
     * StringUtils.substringsBetween("", "[", "]")          = []
     * </pre>
     *
     * @param open the String identifying the start of the substring, empty returns null
     * @param close the String identifying the end of the substring, empty returns null
     * @return a String Array of substrings, or {@code null} if no match
     * @since 2.3
     */
    public String[] substringsBetween(final String open, final String close) {
        return StringUtils.substringsBetween(str, open, close);
    }

    /**
     * Swaps the case of a String changing upper and title case to lower case, and lower case to upper
     * case.
     * <ul>
     * <li>Upper case character converts to Lower case</li>
     * <li>Title case character converts to Lower case</li>
     * <li>Lower case character converts to Upper case</li>
     * </ul>
     * <p>
     * For a word based algorithm, see {org.apache.commons.text.WordUtils#swapCase(String)}. A
     * {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.swapCase(null)                 = null
     * StringUtils.swapCase("")                   = ""
     * StringUtils.swapCase("The dog has a BONE") = "tHE DOG HAS A bone"
     * </pre>
     * <p>
     * NOTE: This method changed in Lang version 2.0. It no longer performs a word based algorithm. If
     * you only use ASCII, you will notice no change. That functionality is available in
     * org.apache.commons.lang3.text.WordUtils.
     * </p>
     *
     * @return the changed String, {@code null} if null String input
     */
    public StrEx swapCase() {
        return with(StringUtils.swapCase(str));
    }

    /**
     * Converts a {@link CharSequence} into an array of code points.
     * <p>
     * Valid pairs of surrogate code units will be converted into a single supplementary code point.
     * Isolated surrogate code units (i.e. a high surrogate not followed by a low surrogate or a low
     * surrogate not preceded by a high surrogate) will be returned as-is.
     * </p>
     *
     * <pre>
     * StringUtils.toCodePoints(null)   =  null
     * StringUtils.toCodePoints("")     =  []  // empty array
     * </pre>
     *
     * @return an array of code points
     * @since 3.6
     */
    public int[] toCodePoints() {
        return StringUtils.toCodePoints(str);
    }

    /**
     * Converts the given source String as a lower-case using the {@link Locale#ROOT} locale in a
     * null-safe manner.
     *
     * @return the given source String as a lower-case using the {@link Locale#ROOT} locale or null.
     * @since 3.10
     */
    public StrEx toRootLowerCase() {
        return with(StringUtils.toRootLowerCase(str));
    }

    /**
     * Converts the given source String as a upper-case using the {@link Locale#ROOT} locale in a
     * null-safe manner.
     *
     * @return the given source String as a upper-case using the {@link Locale#ROOT} locale or null.
     * @since 3.10
     */
    public StrEx toRootUpperCase() {
        return with(StringUtils.toRootUpperCase(str));
    }

    /**
     * Removes control characters (char &lt;= 32) from both ends of this String, handling {@code null}
     * by returning {@code null}.
     * <p>
     * The String is trimmed using {@link String#trim()}. Trim removes start and end characters &lt;=
     * 32. To strip whitespace use {@link #strip(String)}.
     * </p>
     * <p>
     * To trim your choice of characters, use the {#strip(String, String)} methods.
     * </p>
     *
     * <pre>
     * StringUtils.trim(null)          = null
     * StringUtils.trim("")            = ""
     * StringUtils.trim("     ")       = ""
     * StringUtils.trim("abc")         = "abc"
     * StringUtils.trim("    abc    ") = "abc"
     * </pre>
     *
     * @return the trimmed string, {@code null} if null String input
     */
    public StrEx trim() {
        return with(StringUtils.trim(str));
    }

    /**
     * Removes control characters (char &lt;= 32) from both ends of this String returning an empty
     * String ("") if the String is empty ("") after the trim or if it is {@code null}.
     * <p>
     * The String is trimmed using {@link String#trim()}. Trim removes start and end characters &lt;=
     * 32. To strip whitespace use {#stripToEmpty(String)}.
     *
     * <pre>
     * StringUtils.trimToEmpty(null)          = ""
     * StringUtils.trimToEmpty("")            = ""
     * StringUtils.trimToEmpty("     ")       = ""
     * StringUtils.trimToEmpty("abc")         = "abc"
     * StringUtils.trimToEmpty("    abc    ") = "abc"
     * </pre>
     *
     * @return the trimmed String, or an empty String if {@code null} input
     * @since 2.0
     */
    public StrEx trimToEmpty() {
        return with(StringUtils.trimToEmpty(str));
    }

    /**
     * Removes control characters (char &lt;= 32) from both ends of this String returning {@code null}
     * if the String is empty ("") after the trim or if it is {@code null}.
     * <p>
     * The String is trimmed using {@link String#trim()}. Trim removes start and end characters &lt;=
     * 32. To strip whitespace use {@link #stripToNull(String)}.
     *
     * <pre>
     * StringUtils.trimToNull(null)          = null
     * StringUtils.trimToNull("")            = null
     * StringUtils.trimToNull("     ")       = null
     * StringUtils.trimToNull("abc")         = "abc"
     * StringUtils.trimToNull("    abc    ") = "abc"
     * </pre>
     *
     * @return the trimmed String, {@code null} if only chars &lt;= 32, empty or null String input
     * @since 2.0
     */
    public StrEx trimToNull() {
        return with(StringUtils.trimToNull(str));
    }

    /**
     * Truncates a String. This will turn "Now is the time for all good men" into "Now is the time for".
     * <p>
     * Specifically:
     * </p>
     * <ul>
     * <li>If {@code str} is less than {@code maxWidth} characters long, return it.</li>
     * <li>Else truncate it to {@code substring(str, 0, maxWidth)}.</li>
     * <li>If {@code maxWidth} is less than {@code 0}, throw an {@link IllegalArgumentException}.</li>
     * <li>In no case will it return a String of length greater than {@code maxWidth}.</li>
     * </ul>
     *
     * <pre>
     * StringUtils.truncate(null, 0)       = null
     * StringUtils.truncate(null, 2)       = null
     * StringUtils.truncate("", 4)         = ""
     * StringUtils.truncate("abcdefg", 4)  = "abcd"
     * StringUtils.truncate("abcdefg", 6)  = "abcdef"
     * StringUtils.truncate("abcdefg", 7)  = "abcdefg"
     * StringUtils.truncate("abcdefg", 8)  = "abcdefg"
     * StringUtils.truncate("abcdefg", -1) = throws an IllegalArgumentException
     * </pre>
     *
     * @param maxWidth maximum length of result String, must be positive
     * @return truncated String, {@code null} if null String input
     * @throws IllegalArgumentException If {@code maxWidth} is less than {@code 0}
     * @since 3.5
     */
    public StrEx truncate(final int maxWidth) {
        return with(StringUtils.truncate(str, maxWidth));
    }

    /**
     * Truncates a String. This will turn "Now is the time for all good men" into "is the time for all".
     * <p>
     * Works like {@code truncate(String, int)}, but allows you to specify a "left edge" offset.
     * <p>
     * Specifically:
     * </p>
     * <ul>
     * <li>If {@code str} is less than {@code maxWidth} characters long, return it.</li>
     * <li>Else truncate it to {@code substring(str, offset, maxWidth)}.</li>
     * <li>If {@code maxWidth} is less than {@code 0}, throw an {@link IllegalArgumentException}.</li>
     * <li>If {@code offset} is less than {@code 0}, throw an {@link IllegalArgumentException}.</li>
     * <li>In no case will it return a String of length greater than {@code maxWidth}.</li>
     * </ul>
     *
     * <pre>
     * StringUtils.truncate(null, 0, 0) = null
     * StringUtils.truncate(null, 2, 4) = null
     * StringUtils.truncate("", 0, 10) = ""
     * StringUtils.truncate("", 2, 10) = ""
     * StringUtils.truncate("abcdefghij", 0, 3) = "abc"
     * StringUtils.truncate("abcdefghij", 5, 6) = "fghij"
     * StringUtils.truncate("raspberry peach", 10, 15) = "peach"
     * StringUtils.truncate("abcdefghijklmno", 0, 10) = "abcdefghij"
     * StringUtils.truncate("abcdefghijklmno", -1, 10) = throws an IllegalArgumentException
     * StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, 10) = throws an IllegalArgumentException
     * StringUtils.truncate("abcdefghijklmno", Integer.MIN_VALUE, Integer.MAX_VALUE) = throws an IllegalArgumentException
     * StringUtils.truncate("abcdefghijklmno", 0, Integer.MAX_VALUE) = "abcdefghijklmno"
     * StringUtils.truncate("abcdefghijklmno", 1, 10) = "bcdefghijk"
     * StringUtils.truncate("abcdefghijklmno", 2, 10) = "cdefghijkl"
     * StringUtils.truncate("abcdefghijklmno", 3, 10) = "defghijklm"
     * StringUtils.truncate("abcdefghijklmno", 4, 10) = "efghijklmn"
     * StringUtils.truncate("abcdefghijklmno", 5, 10) = "fghijklmno"
     * StringUtils.truncate("abcdefghijklmno", 5, 5) = "fghij"
     * StringUtils.truncate("abcdefghijklmno", 5, 3) = "fgh"
     * StringUtils.truncate("abcdefghijklmno", 10, 3) = "klm"
     * StringUtils.truncate("abcdefghijklmno", 10, Integer.MAX_VALUE) = "klmno"
     * StringUtils.truncate("abcdefghijklmno", 13, 1) = "n"
     * StringUtils.truncate("abcdefghijklmno", 13, Integer.MAX_VALUE) = "no"
     * StringUtils.truncate("abcdefghijklmno", 14, 1) = "o"
     * StringUtils.truncate("abcdefghijklmno", 14, Integer.MAX_VALUE) = "o"
     * StringUtils.truncate("abcdefghijklmno", 15, 1) = ""
     * StringUtils.truncate("abcdefghijklmno", 15, Integer.MAX_VALUE) = ""
     * StringUtils.truncate("abcdefghijklmno", Integer.MAX_VALUE, Integer.MAX_VALUE) = ""
     * StringUtils.truncate("abcdefghij", 3, -1) = throws an IllegalArgumentException
     * StringUtils.truncate("abcdefghij", -2, 4) = throws an IllegalArgumentException
     * </pre>
     *
     * @param offset left edge of source String
     * @param maxWidth maximum length of result String, must be positive
     * @return truncated String, {@code null} if null String input
     * @throws IllegalArgumentException If {@code offset} or {@code maxWidth} is less than {@code 0}
     * @since 3.5
     */
    public StrEx truncate(final int offset, final int maxWidth) {
        return with(StringUtils.truncate(str, offset, maxWidth));
    }

    /**
     * Uncapitalizes a String, changing the first character to lower case as per
     * {@link Character#toLowerCase(int)}. No other characters are changed.
     * <p>
     * For a word based algorithm, see {org.apache.commons.text.WordUtils#uncapitalize(String)}. A
     * {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.uncapitalize(null)  = null
     * StringUtils.uncapitalize("")    = ""
     * StringUtils.uncapitalize("cat") = "cat"
     * StringUtils.uncapitalize("Cat") = "cat"
     * StringUtils.uncapitalize("CAT") = "cAT"
     * </pre>
     *
     * @return the uncapitalized String, {@code null} if null String input
     * @since 2.0
     */
    public StrEx uncapitalize() {
        return with(StringUtils.uncapitalize(str));
    }

    /**
     * Unwraps a given string from a character.
     *
     * <pre>
     * StringUtils.unwrap(null, null)         = null
     * StringUtils.unwrap(null, '\0')         = null
     * StringUtils.unwrap(null, '1')          = null
     * StringUtils.unwrap("a", 'a')           = "a"
     * StringUtils.unwrap("aa", 'a')           = ""
     * StringUtils.unwrap("\'abc\'", '\'')    = "abc"
     * StringUtils.unwrap("AABabcBAA", 'A')   = "ABabcBA"
     * StringUtils.unwrap("A", '#')           = "A"
     * StringUtils.unwrap("#A", '#')          = "#A"
     * StringUtils.unwrap("A#", '#')          = "A#"
     * </pre>
     *
     * @param wrapChar the character used to unwrap
     * @return unwrapped String or the original string if it is not quoted properly with the wrapChar
     * @since 3.6
     */
    public StrEx unwrap(final char wrapChar) {
        return with(StringUtils.unwrap(str, wrapChar));
    }

    /**
     * Unwraps a given string from another string.
     *
     * <pre>
     * StringUtils.unwrap(null, null)         = null
     * StringUtils.unwrap(null, "")           = null
     * StringUtils.unwrap(null, "1")          = null
     * StringUtils.unwrap("a", "a")           = "a"
     * StringUtils.unwrap("aa", "a")          = ""
     * StringUtils.unwrap("\'abc\'", "\'")    = "abc"
     * StringUtils.unwrap("\"abc\"", "\"")    = "abc"
     * StringUtils.unwrap("AABabcBAA", "AA")  = "BabcB"
     * StringUtils.unwrap("A", "#")           = "A"
     * StringUtils.unwrap("#A", "#")          = "#A"
     * StringUtils.unwrap("A#", "#")          = "A#"
     * </pre>
     *
     * @param wrapToken the String used to unwrap
     * @return unwrapped String or the original string if it is not quoted properly with the wrapToken
     * @since 3.6
     */
    public StrEx unwrap(final String str, final String wrapToken) {
        return with(StringUtils.unwrap(str, wrapToken));
    }

    /**
     * Converts a String to upper case as per {@link String#toUpperCase()}.
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.upperCase(null)  = null
     * StringUtils.upperCase("")    = ""
     * StringUtils.upperCase("aBc") = "ABC"
     * </pre>
     * <p>
     * <strong>Note:</strong> As described in the documentation for {@link String#toUpperCase()}, the
     * result of this method is affected by the current locale. For platform-independent case
     * transformations, the method {#upperCase(String, Locale)} should be used with a specific locale
     * (e.g. {@link Locale#ENGLISH}).
     * </p>
     *
     * @return the upper-cased String, {@code null} if null String input
     */
    public StrEx upperCase() {
        return with(StringUtils.upperCase(str));
    }

    /**
     * Converts a String to upper case as per {@link String#toUpperCase(Locale)}.
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.upperCase(null, Locale.ENGLISH)  = null
     * StringUtils.upperCase("", Locale.ENGLISH)    = ""
     * StringUtils.upperCase("aBc", Locale.ENGLISH) = "ABC"
     * </pre>
     *
     * @param locale the locale that defines the case transformation rules, must not be null
     * @return the upper-cased String, {@code null} if null String input
     * @since 2.5
     */
    public StrEx upperCase(final Locale locale) {
        return with(StringUtils.upperCase(str, locale));
    }

    /**
     * Wraps a string with a char.
     *
     * <pre>
     * StringUtils.wrap(null, *)        = null
     * StringUtils.wrap("", *)          = ""
     * StringUtils.wrap("ab", '\0')     = "ab"
     * StringUtils.wrap("ab", 'x')      = "xabx"
     * StringUtils.wrap("ab", '\'')     = "'ab'"
     * StringUtils.wrap("\"ab\"", '\"') = "\"\"ab\"\""
     * </pre>
     *
     * @param wrapWith the char that will wrap {@code str}
     * @return the wrapped string, or {@code null} if {@code str==null}
     * @since 3.4
     */
    public StrEx wrap(final char wrapWith) {
        return with(StringUtils.wrap(str, wrapWith));
    }

    /**
     * Wraps a String with another String.
     * <p>
     * A {@code null} input String returns {@code null}.
     * </p>
     *
     * <pre>
     * StringUtils.wrap(null, *)         = null
     * StringUtils.wrap("", *)           = ""
     * StringUtils.wrap("ab", null)      = "ab"
     * StringUtils.wrap("ab", "x")       = "xabx"
     * StringUtils.wrap("ab", "\"")      = "\"ab\""
     * StringUtils.wrap("\"ab\"", "\"")  = "\"\"ab\"\""
     * StringUtils.wrap("ab", "'")       = "'ab'"
     * StringUtils.wrap("'abcd'", "'")   = "''abcd''"
     * StringUtils.wrap("\"abcd\"", "'") = "'\"abcd\"'"
     * StringUtils.wrap("'abcd'", "\"")  = "\"'abcd'\""
     * </pre>
     *
     * @param wrapWith the String that will wrap str
     * @return wrapped String, {@code null} if null String input
     * @since 3.4
     */
    public StrEx wrap(final String wrapWith) {
        return with(StringUtils.wrap(str, wrapWith));
    }

    /**
     * Wraps a string with a char if that char is missing from the start or end of the given string.
     * <p>
     * A new {@link String} will not be created if {@code str} is already wrapped.
     * </p>
     *
     * <pre>
     * StringUtils.wrapIfMissing(null, *)        = null
     * StringUtils.wrapIfMissing("", *)          = ""
     * StringUtils.wrapIfMissing("ab", '\0')     = "ab"
     * StringUtils.wrapIfMissing("ab", 'x')      = "xabx"
     * StringUtils.wrapIfMissing("ab", '\'')     = "'ab'"
     * StringUtils.wrapIfMissing("\"ab\"", '\"') = "\"ab\""
     * StringUtils.wrapIfMissing("/", '/')  = "/"
     * StringUtils.wrapIfMissing("a/b/c", '/')  = "/a/b/c/"
     * StringUtils.wrapIfMissing("/a/b/c", '/')  = "/a/b/c/"
     * StringUtils.wrapIfMissing("a/b/c/", '/')  = "/a/b/c/"
     * </pre>
     *
     * @param wrapWith the char that will wrap {@code str}
     * @return the wrapped string, or {@code null} if {@code str==null}
     * @since 3.5
     */
    public StrEx wrapIfMissing(final char wrapWith) {
        return with(StringUtils.wrapIfMissing(str, wrapWith));
    }

    /**
     * Wraps a string with a string if that string is missing from the start or end of the given string.
     * <p>
     * A new {@link String} will not be created if {@code str} is already wrapped.
     * </p>
     *
     * <pre>
     * StringUtils.wrapIfMissing(null, *)         = null
     * StringUtils.wrapIfMissing("", *)           = ""
     * StringUtils.wrapIfMissing("ab", null)      = "ab"
     * StringUtils.wrapIfMissing("ab", "x")       = "xabx"
     * StringUtils.wrapIfMissing("ab", "\"")      = "\"ab\""
     * StringUtils.wrapIfMissing("\"ab\"", "\"")  = "\"ab\""
     * StringUtils.wrapIfMissing("ab", "'")       = "'ab'"
     * StringUtils.wrapIfMissing("'abcd'", "'")   = "'abcd'"
     * StringUtils.wrapIfMissing("\"abcd\"", "'") = "'\"abcd\"'"
     * StringUtils.wrapIfMissing("'abcd'", "\"")  = "\"'abcd'\""
     * StringUtils.wrapIfMissing("/", "/")  = "/"
     * StringUtils.wrapIfMissing("a/b/c", "/")  = "/a/b/c/"
     * StringUtils.wrapIfMissing("/a/b/c", "/")  = "/a/b/c/"
     * StringUtils.wrapIfMissing("a/b/c/", "/")  = "/a/b/c/"
     * </pre>
     *
     * @param wrapWith the string that will wrap {@code str}
     * @return the wrapped string, or {@code null} if {@code str==null}
     * @since 3.5
     */
    public StrEx wrapIfMissing(final String wrapWith) {
        return with(StringUtils.wrapIfMissing(str, wrapWith));
    }
}
